> 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>