Re: [PATCH 02/20] afs: Fix checker warnings

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

 



On Thu, Apr 05, 2018 at 09:29:42PM +0100, David Howells wrote:
> Fix warnings raised by checker, including:
> 
>  (*) Warnings raised by unequal comparison for the purposes of sorting,
>      where the endianness doesn't matter:
> 
> fs/afs/addr_list.c:246:21: warning: restricted __be16 degrades to integer
> fs/afs/addr_list.c:246:30: warning: restricted __be16 degrades to integer
> fs/afs/addr_list.c:248:21: warning: restricted __be32 degrades to integer
> fs/afs/addr_list.c:248:49: warning: restricted __be32 degrades to integer
> fs/afs/addr_list.c:283:21: warning: restricted __be16 degrades to integer
> fs/afs/addr_list.c:283:30: warning: restricted __be16 degrades to integer

Seriously - just do the endian swap.  In most case it it free anyway
becaue you have load instructions that can byte swap.  Bonus points
for doing the swap on the element iterated over.

__force hacks without a very good reason (and an explanation for the
reason in the code!) are an instance reason to NAK.

>  (*) afs_find_server() casts __be16/__be32 values to int in order to
>      directly compare them for the purpose of finding a match in a list,
>      but is should also annotate the cast with __force to avoid checker
>      warnings.

Same as above.



[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