All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Rylan Dmello <mail@rylan.coffee>
Cc: Manish Chopra <manishc@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	netdev@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/7] staging: qlge: Remove gotos from ql_set_mac_addr_reg
Date: Thu, 30 Apr 2020 03:03:07 -0700	[thread overview]
Message-ID: <4c91091b304fc5df2a2f292a1e0c78d80217bb94.camel@perches.com> (raw)
In-Reply-To: <20200430093835.GT2014@kadam>

On Thu, 2020-04-30 at 12:38 +0300, Dan Carpenter wrote:
> On Wed, Apr 29, 2020 at 09:33:04PM -0400, Rylan Dmello wrote:
> > As suggested by Joe Perches, this patch removes the 'exit' label
> > from the ql_set_mac_addr_reg function and replaces the goto
> > statements with break statements.
[]
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
[]
> > @@ -336,22 +336,20 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
> >  
> >  		status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
> >  		if (status)
> > -			goto exit;
> > +			break;
> 
> Just "return status".  A direct return is immediately clear but with a
> break statement then you have to look down a bit and then scroll back.

To me, 6 of 1, half dozen of other as
all the case breaks could be returns.

So either form is fine with me.

The old form was poor through.



WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Rylan Dmello <mail@rylan.coffee>
Cc: devel@driverdev.osuosl.org, GR-Linux-NIC-Dev@marvell.com,
	Manish Chopra <manishc@marvell.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 2/7] staging: qlge: Remove gotos from ql_set_mac_addr_reg
Date: Thu, 30 Apr 2020 03:03:07 -0700	[thread overview]
Message-ID: <4c91091b304fc5df2a2f292a1e0c78d80217bb94.camel@perches.com> (raw)
In-Reply-To: <20200430093835.GT2014@kadam>

On Thu, 2020-04-30 at 12:38 +0300, Dan Carpenter wrote:
> On Wed, Apr 29, 2020 at 09:33:04PM -0400, Rylan Dmello wrote:
> > As suggested by Joe Perches, this patch removes the 'exit' label
> > from the ql_set_mac_addr_reg function and replaces the goto
> > statements with break statements.
[]
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
[]
> > @@ -336,22 +336,20 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
> >  
> >  		status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
> >  		if (status)
> > -			goto exit;
> > +			break;
> 
> Just "return status".  A direct return is immediately clear but with a
> break statement then you have to look down a bit and then scroll back.

To me, 6 of 1, half dozen of other as
all the case breaks could be returns.

So either form is fine with me.

The old form was poor through.


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-04-30 10:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  1:31 [PATCH v2 0/7] staging: qlge: Checkpatch.pl indentation fixes in qlge_main.c Rylan Dmello
2020-04-30  1:31 ` Rylan Dmello
2020-04-30  1:32 ` [PATCH v2 1/7] staging: qlge: Fix indentation in ql_set_mac_addr_reg Rylan Dmello
2020-04-30  1:32   ` Rylan Dmello
2020-04-30  1:33 ` [PATCH v2 2/7] staging: qlge: Remove gotos from ql_set_mac_addr_reg Rylan Dmello
2020-04-30  1:33   ` Rylan Dmello
2020-04-30  9:38   ` Dan Carpenter
2020-04-30  9:38     ` Dan Carpenter
2020-04-30 10:03     ` Joe Perches [this message]
2020-04-30 10:03       ` Joe Perches
2020-04-30 10:08       ` Dan Carpenter
2020-04-30 10:08         ` Dan Carpenter
2020-04-30  1:33 ` [PATCH v2 3/7] staging: qlge: Fix indentation in ql_get_mac_addr_reg Rylan Dmello
2020-04-30  1:33   ` Rylan Dmello
2020-04-30  1:33 ` [PATCH v2 4/7] staging: qlge: Remove goto statements from ql_get_mac_addr_reg Rylan Dmello
2020-04-30  1:33   ` Rylan Dmello
2020-04-30  1:34 ` [PATCH v2 5/7] staging: qlge: Remove multi-line dereference from ql_request_irq Rylan Dmello
2020-04-30  1:34   ` Rylan Dmello
2020-04-30  1:34 ` [PATCH v2 6/7] staging: qlge: Fix suspect code indent warning in ql_init_device Rylan Dmello
2020-04-30  1:34   ` Rylan Dmello
2020-04-30  1:35 ` [PATCH v2 7/7] staging: qlge: Fix function argument alignment " Rylan Dmello
2020-04-30  1:35   ` Rylan Dmello
2020-04-30  1:51 ` [PATCH v2 0/7] staging: qlge: Checkpatch.pl indentation fixes in qlge_main.c Joe Perches
2020-04-30  1:51   ` Joe Perches

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=4c91091b304fc5df2a2f292a1e0c78d80217bb94.camel@perches.com \
    --to=joe@perches.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@rylan.coffee \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    /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.