public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Dipendra Khadka <kdipendra88@gmail.com>
Cc: lee@kernel.org, pavel@ucw.cz, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] leds: bcm6328: Replace divide condition with comparison for shift value
Date: Sat, 23 Nov 2024 21:55:46 +0200	[thread overview]
Message-ID: <Z0IzQlsP6OMCcXRB@surfacebook.localdomain> (raw)
In-Reply-To: <20241019073302.35499-1-kdipendra88@gmail.com>

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@gmail.com/
https://lore.kernel.org/all/20241121105838.4073659-4-andriy.shevchenko@linux.intel.com/

-- 
With Best Regards,
Andy Shevchenko



      parent reply	other threads:[~2024-11-23 19:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-19  7:33 [PATCH v2] leds: bcm6328: Replace divide condition with comparison for shift value Dipendra Khadka
2024-10-31 16:10 ` (subset) " Lee Jones
2024-11-23 19:55 ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z0IzQlsP6OMCcXRB@surfacebook.localdomain \
    --to=andy.shevchenko@gmail.com \
    --cc=kdipendra88@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox