Re: fs/hfsplus/xattr.c: comparison of distinct pointer types lacks a cast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christian,

On Sun, May 25, 2014 at 3:42 AM, Christian Kujau <lists@xxxxxxxxxxxxxxx> wrote:
> /usr/local/src/linux-git/include/asm-generic/div64.h:43:28: warning:
> comparison of distinct pointer types lacks a cast [enabled by default]
>   (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
>                             ^
> /usr/local/src/linux-git/fs/hfsplus/xattr.c:86:2: note: in expansion of
> macro 'do_div'
>   do_div(tmp, node_size);
>   ^
>   LD [M]  fs/hfsplus/hfsplus.o
>
> ---------------------------------------------------------------
>
> I don't fully understand the issue here, but xattr.c:86 reads:
>
>            do_div(tmp, node_size);

"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". Does that make the warning go away?

> Now, "git log -S do_div --source fs/hfsplus/xattr.c" brought up the
> following commit from Geert, introducing do_div() to xattr.c
>
>   commit a99b7069aab8fc3fb4f26d15795dc280b52e38b1 HEAD
>   Author: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
>   Date:   Thu Nov 14 14:32:18 2013 -0800
>   hfsplus: Fix undefined __divdi3 in hfsplus_init_header_node()
>
> Reverting this commit makes the warning above go away, but I doubt this
> would be the correct solution here :-)

Indeed ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux