fs/hfsplus/xattr.c: comparison of distinct pointer types lacks a cast
lists at nerdbynature.de
Mon May 26 05:07:38 EST 2014
On Sun, 25 May 2014 at 10:48, Geert Uytterhoeven wrote:
> "tmp" is "loff_t" which is "__kernel_loff_t", which is "long long", i.e. signed,
> while include/asm-generic/div64.h compares its type with "uint64_t".
Thanks for the explanation!
> As inode sizes are positive, it should be safe to change the type of "tmp"
> to "u64". Does that make the warning go away?
Yes, this helped! Compile-tested only:
Signed-off-by: Christian Kujau <lists at nerdbynature.de>
Fixed-by: Geert Uytterhoeven <geert at linux-m68k.org>
Commit a99b7069aab8fc3fb4f26d15795dc280b52e38b1 introduced do_div() to
xattr.c and the warning below too.
As Geert remarked: "tmp" is "loff_t" which is "__kernel_loff_t", which
is "long long", i.e. signed, while include/asm-generic/div64.h compares
its type with "uint64_t". As inode sizes are positive, it should be safe
to change the type of "tmp" to "u64".
CC [M] fs/hfsplus/xattr_user.o
CC [M] fs/hfsplus/xattr_security.o
CC [M] fs/hfsplus/xattr.o
CC [M] fs/hfsplus/xattr_trusted.o
In file included from
fs/hfsplus/xattr.c: In function
comparison of distinct pointer types lacks a cast [enabled by default]
(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
fs/hfsplus/xattr.c:86:2: note: in expansion of
LD [M] fs/hfsplus/hfsplus.o
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index 4e27edc..cd9ed4c 100644
@@ -66,7 +66,7 @@ static void hfsplus_init_header_node(struct inode *attr_file,
- loff_t tmp;
+ u64 tmp;
hfs_dbg(ATTR_MOD, "init_hdr_attr_file: clump %u, node_size %u\n",
BOFH excuse #388:
Bad user karma.
More information about the Linuxppc-dev