Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382543

Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test

From Mason <slash.tmp@free.fr>
Newsgroups linux.kernel
Subject Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test
Date 2016-04-19 16:10 +0200
Message-ID <rpEvM-87k-13@gated-at.bofh.it> (permalink)
References <rpCNk-6J2-15@gated-at.bofh.it> <rpDJn-7sx-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 19/04/2016 15:13, Daniel Lezcano wrote:

> On Tue, Apr 19, 2016 at 02:15:15PM +0200, Mason wrote:
>
>> From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>>
>> Commit 0881841f7e78 changed "if (ret != 0)" to "if (!ret)"
>>
>> Fixes: 0881841f7e78 ("Replace code by clocksource_mmio_init")
>> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
>> ---
> 
> Please resend the patch with the fix only, without s/ret/err/

As I wrote on IRC, I think it is misguided to consider variable
renaming as not part of the fix. A properly named variable helps
reviewers by communicating intent.

Had I named the variable 'err' in the first place, would you have
introduced the bug by writing

  if (!err) {
    pr_err("registration failed");
  }

or would if (!err) have jumped out for an error path?
(Not a rhetorical question; if you say it would not have helped,
then I guess my mental workflow is different.)

How do others feel about this? Thomas?

Regards.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Mason <slash.tmp@free.fr> - 2016-04-19 14:20 +0200
  Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-19 15:20 +0200
    Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Mason <slash.tmp@free.fr> - 2016-04-19 16:10 +0200
      Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-19 17:10 +0200
        Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Mason <slash.tmp@free.fr> - 2016-04-19 19:30 +0200
          Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-19 19:40 +0200
            Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Mason <slash.tmp@free.fr> - 2016-04-19 20:30 +0200
              Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-04-20 07:00 +0200

csiph-web