public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL] Regulator fixes for 2.6.38
@ 2011-02-25 21:33 Liam Girdwood
  2011-02-25 22:10 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Liam Girdwood @ 2011-02-25 21:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Mark Brown, linux-kernel

Linus,

Please pull the following regulator fixes for 2.6.38.

Thanks

Liam

---

The following changes since commit 4662db446190ddef8fbab024f72dee77dd04b8f2:

  Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 (2011-02-24 17:08:48 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6.git for-linus

Jesper Juhl (1):
      regulator, mc13xxx: Remove pointless test for unsigned less than zero

Mark Brown (1):
      regulator: Fix warning with CONFIG_BUG disabled

 drivers/regulator/mc13xxx-regulator-core.c |    2 +-
 drivers/regulator/wm831x-dcdc.c            |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [GIT PULL] Regulator fixes for 2.6.38
  2011-02-25 21:33 [GIT PULL] Regulator fixes for 2.6.38 Liam Girdwood
@ 2011-02-25 22:10 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2011-02-25 22:10 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Mark Brown, linux-kernel, Jesper Juhl

On Fri, Feb 25, 2011 at 1:33 PM, Liam Girdwood <lrg@slimlogic.co.uk> wrote:
>
> Jesper Juhl (1):
>      regulator, mc13xxx: Remove pointless test for unsigned less than zero

So I absolutely detest patches like this.

It's not AT ALL pointless to write

   BUG_ON(x < 0 || x > XYZ);

because tests like that make it obvious that there are no sign issues,
without anybody ever having to worry about the sign. So it makes the
code more readable, and the intention more obvious. There is no
downside.

If it's an unsigned variable, the compiler can optimize away the test
against zero. In fact, it can do so even if it's signed (assuming XYZ
is a positive compile-time constant integer) and turn it into an
unsigned comparison.

So I did the pull, but I want to raise my objection to patches like
this. They are doubly wrong during the late -rc stage, but they are
wrong even otherwise.

If you have a compiler that warns about the test, you have a compiler
that is pure and utter shit. It's that simple.

                                    Linus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-25 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 21:33 [GIT PULL] Regulator fixes for 2.6.38 Liam Girdwood
2011-02-25 22:10 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox