Re: [PATCH] byteswap: don't use __builtin_bswap*() with sparse

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

 



On Thursday, August 11, 2016 1:15:02 PM CEST Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> 
> Although sparse declares __builtin_bswap*(), it can't actually
> do constant folding inside them (yet). As such, things like
> 
>   switch (protocol) {
>   case htons(ETH_P_IP):
>           break;
>   }
> 
> which we do all over the place cause sparse to warn that it
> expects a constant instead of a function call.
> 
> Disable __HAVE_BUILTIN_BSWAP*__ if __CHECKER__ is defined to
> avoid this.
> 
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Fixes: 7322dd755e7d ("byteswap: try to avoid __builtin_constant_p gcc bug")
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>

Looks good, thanks for addressing this!

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux