Re: [PATCH v2] leds: bcm6328: Replace divide condition with comparison for shift value

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

 



Sat, Oct 19, 2024 at 07:33:01AM +0000, Dipendra Khadka kirjoitti:
> Fixes the following Smatch warnings:
> drivers/leds/leds-bcm6328.c:116 bcm6328_led_mode() warn: replace divide condition 'shift / 16' with 'shift >= 16'
> drivers/leds/leds-bcm6328.c:360 bcm6328_led() warn: replace divide condition 'shift / 16' with 'shift >= 16'

As discussed with Dan (author of smatch), these warnings make no much sense as
"division" by power-of-two numbers in modern world (ISAs, compilers, etc) most
unlikely become a real division instruction with all bad consequences. Even
though, some ISAs can optimize cases where foo / 16; foo % 16 goes together and
this change may break that.

So, please, consider not to send such changes in the future because at least
they are just noise, at most might add a (micro-)rgressions.

https://lore.kernel.org/linux-gpio/20241112201659.16785-1-surajsonawane0215@xxxxxxxxx/
https://lore.kernel.org/all/20241121105838.4073659-4-andriy.shevchenko@xxxxxxxxxxxxxxx/

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux