mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	SF Markus Elfring <elfring@users.sourceforge.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"Dan Carpenter" <dan.carpenter@oracle.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eugeniu Rosca" <erosca@de.adit-jv.com>,
	"Kazuya Mizuguchi" <kazuya.mizuguchi.ks@renesas.com>,
	"Masaru Nagai" <masaru.nagai.vx@renesas.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Simon Horman" <horms+renesas@verge.net.au>,
	"Yuval Shaia" <yuval.shaia@oracle.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] ravb: Use common error handling code in ravb_probe()
Date: Tue, 31 Oct 2017 00:08:44 +0300	[thread overview]
Message-ID: <161f4ef9-89b7-bfad-89e7-06bdeeb9ac31@cogentembedded.com> (raw)
In-Reply-To: <CAMuHMdXEWpryexcrN7OYcsGfyE3Y_-7Ej2CfgvYgUbZFTTHEWg@mail.gmail.com>

On 10/29/2017 02:00 PM, Geert Uytterhoeven wrote:

>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Sat, 28 Oct 2017 19:10:08 +0200
>>
>> Add a jump target so that a bit of exception handling can be better reused
>> at the end of this function.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>> ---
>>   drivers/net/ethernet/renesas/ravb_main.c | 32 ++++++++++++++++----------------
>>   1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>> index a8822a756e08..62dbdf7de6cd 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -2069,10 +2069,9 @@ static int ravb_probe(struct platform_device *pdev)
>>                  irq = platform_get_irq_byname(pdev, "ch22");
>>          else
>>                  irq = platform_get_irq(pdev, 0);
>> -       if (irq < 0) {
>> -               error = irq;
>> -               goto out_release;
>> -       }
>> +       if (irq < 0)
>> +               goto failure_indication;
> 
> IMHO, it's really confusing that "irq" contains the error code, not "error".

    I think it would have been equally confusing if 'error' was assigned to 
'ndev->irq', etc. It's just the duality of the result of these functions that 
makes them confusing...

> Especially when jumping to a meaningless label named "failure_indication"
> ("irq_failure" would be more intuitive).

    Yeah, the label sucks. :-)

> So I prefer the original code, regardless of the label name.

    On the 2nd thought, the patch can be fixed up and then merged.

> Gr{oetje,eeting}s,
> 
>                          Geert

MBR, Sergei

  parent reply	other threads:[~2017-10-30 21:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-28 17:19 SF Markus Elfring
2017-10-29 11:00 ` Geert Uytterhoeven
2017-10-29 11:50   ` SF Markus Elfring
2017-10-30 21:08   ` Sergei Shtylyov [this message]
2017-10-30 20:51 ` Sergei Shtylyov
2017-10-30 21:19   ` Sergei Shtylyov

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=161f4ef9-89b7-bfad-89e7-06bdeeb9ac31@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=elfring@users.sourceforge.net \
    --cc=erosca@de.adit-jv.com \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=kazuya.mizuguchi.ks@renesas.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=masaru.nagai.vx@renesas.com \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=yuval.shaia@oracle.com \
    /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

all inboxes | Powered by JetHome®