lkml.org 
[lkml]   [2007]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@it.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-06-17 13:59    [W:0.029 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site