All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
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 16:05:19 +0200	[thread overview]
Message-ID: <57163B1F.7050402@free.fr> (raw)
In-Reply-To: <20160419131330.GA419@linaro.org>

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.

  reply	other threads:[~2016-04-19 14:05 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 [this message]
2016-04-19 14:59     ` Daniel Lezcano
2016-04-19 17:21       ` Mason
2016-04-19 17:31         ` Daniel Lezcano
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=57163B1F.7050402@free.fr \
    --to=slash.tmp@free.fr \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=sf84@laposte.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.