public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Mason <slash.tmp@free.fr>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Frias <sf84@laposte.net>,
	Mans Rullgard <mans@mansr.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test
Date: Tue, 19 Apr 2016 19:31:04 +0200	[thread overview]
Message-ID: <20160419173104.GA5862@linaro.org> (raw)
In-Reply-To: <57166910.2080703@free.fr>

On Tue, Apr 19, 2016 at 07:21:20PM +0200, Mason wrote:
> On 19/04/2016 16:59, Daniel Lezcano wrote:
> > On Tue, Apr 19, 2016 at 04:05:19PM +0200, Mason wrote:
> >> 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.)
> > 
> > Ok I won't argue for a stupid variable name.
> > 
> > The point is we are at v4.6-rc4 and even if the change is obvious, it is a 
> > good practice to do a simple change:
> > 
> > -       if (!ret) {
> > +       if (ret) {
> > 
> > Why ? Because maintainers have a lot of code to review, and removing the 
> > noise as much as possible helps them to make their life easier especially 
> > when they have to pay double attention for fixes at RC.
> > 
> > If the 'ret' name is a problem for you, just send another patch for v4.7 to 
> > change the name.
> 
> I want to be sure I understand, please correct me if I'm wrong.
> 
> 1) you have already committed the minimal fix above (changing only
> the test, and keeping the original variable name) and this will be
> pushed to linux-next for the upcoming v4.6-rc

yes.
 
> 2) if I want to change the variable name, I can send another patch,
> to be pushed in the next merge window, for v4.7

yes.

> Do you agree that 2) would be a (minor) improvement?
> If not, I will not bother with the patch.

Usually people are using 'ret'

grep -r "ret =" drivers/ | wc -l
76754

or are using 'err'

grep -r "err =" drivers/ | wc -l
27940

Up to you ...

Thanks.

  -- Daniel

  reply	other threads:[~2016-04-19 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 12:15 [PATCH] clocksource/drivers/tango-xtal: Fix incorrect test Mason
2016-04-19 13:13 ` Daniel Lezcano
2016-04-19 14:05   ` Mason
2016-04-19 14:59     ` Daniel Lezcano
2016-04-19 17:21       ` Mason
2016-04-19 17:31         ` Daniel Lezcano [this message]
2016-04-19 18:22           ` Mason
2016-04-20  4:55             ` Daniel Lezcano

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=20160419173104.GA5862@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=sf84@laposte.net \
    --cc=slash.tmp@free.fr \
    --cc=tglx@linutronix.de \
    /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