Re: [PATCH 2/3] s390/bitops: Limit return value range of __flogr()

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

 



> With the recent ffs() and ffs64() optimization a logical and operation was
> removed, which allows the compiler to tell that the return value range of
> both functions. This may lead to compile warnings as reported by the kernel
> test robot.
> 
> Instead of only adding the not needed mask again, also add an __assume()
> statement to tell newer compilers that they can assume a specific value
> range. This allows newer compilers to optimize the not-needed logical and
> operation away.
> 
> Also change the return type of flogr() to unsigned long and add the const
> attribute to the function.
> 
> With this the reported warning is away, and in addition the kernel image
> size is reduced by ~4kb.
> 
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508211859.UoYsJbLN-lkp@xxxxxxxxx/
> Fixes: de88e74889a3 ("s390/bitops: Slightly optimize ffs() and fls64()")
> Suggested-by: Juergen Christ <jchrist@xxxxxxxxxxxxx>
> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>

Reviewed-by: Juergen Christ <jchrist@xxxxxxxxxxxxx>




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux