[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200706171156.l5HBu7Vs025573@harpo.it.uu.se>
Date: Sun, 17 Jun 2007 13:56:07 +0200 (MEST)
From: Mikael Pettersson <mikpe@...uu.se>
To: neilb@...e.de
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 2.6.22-rc5] nfsd: fix pointer-to-int cast warning
nfsctl.c:write_getfs() open-codes offsetof, but does it poorly
resulting in the following warning on 64-bit machines:
fs/nfsd/nfsctl.c: In function 'write_getfs':
fs/nfsd/nfsctl.c:248: warning: cast from pointer to integer of different size
Fix: use offsetof().
Signed-off-by: Mikael Pettersson <mikpe@...uu.se>
--- linux-2.6.22-rc5/fs/nfsd/nfsctl.c.~1~ 2007-04-26 14:59:37.000000000 +0200
+++ linux-2.6.22-rc5/fs/nfsd/nfsctl.c 2007-06-17 13:30:32.000000000 +0200
@@ -245,7 +245,7 @@ static ssize_t write_getfs(struct file *
}
exp_readunlock();
if (err == 0)
- err = res->fh_size + (int)&((struct knfsd_fh*)0)->fh_base;
+ err = res->fh_size + offsetof(struct knfsd_fh, fh_base);
out:
return err;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists