public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rylan Dmello <mail@rylan.coffee>
To: Joe Perches <joe@perches.com>
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 1/3] staging: qlge: Remove multi-line dereferences from qlge_main.c
Date: Wed, 29 Apr 2020 00:55:16 -0400	[thread overview]
Message-ID: <20200429045516.GA2421@athena> (raw)
In-Reply-To: <0dcf9712a49968da1935061de130bc3668e63088.camel@perches.com>

On Tue, Apr 28, 2020 at 09:31:10PM -0700, Joe Perches wrote:
> On Wed, 2020-04-29 at 00:04 -0400, Rylan Dmello wrote:
> > Fix checkpatch.pl warnings:
> > 
> >   WARNING: Avoid multiple line dereference - prefer 'qdev->func'
> >   WARNING: Avoid multiple line dereference - prefer 'qdev->flags'
> 
> Assuming you are doing this for exercise:
> 
> It'd be better to unindent all the switch/case
> blocks for the entire function so more functions
> fit on single lines
> 
> 	switch (foo) {
> 	case bar:
> 		{
> 			...;
> 
> should be:
> 
> 	switch (foo) {
> 	case bar: {
> 		...;
> 
> goto exit; might as well be break; and remove
> the exit label too.
>

Thank you - I noticed that clang-format unindented the switch-case blocks, but
wasn't sure whether to include that in this patch set or not.

I will send a V2 patch that unindents these switch-case blocks throughout
the two functions listed here, and also removes the exit label from this
function.

> > Signed-off-by: Rylan Dmello <mail@rylan.coffee>
> > ---
> >  drivers/staging/qlge/qlge_main.c | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> > index d7e4dfafc1a3..10daae025790 100644
> > --- a/drivers/staging/qlge/qlge_main.c
> > +++ b/drivers/staging/qlge/qlge_main.c
> > @@ -396,8 +396,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
> >  			 * the route field to NIC core.
> >  			 */
> >  			cam_output = (CAM_OUT_ROUTE_NIC |
> > -				      (qdev->
> > -				       func << CAM_OUT_FUNC_SHIFT) |
> > +				      (qdev->func << CAM_OUT_FUNC_SHIFT) |
> >  					(0 << CAM_OUT_CQ_ID_SHIFT));
> >  			if (qdev->ndev->features & NETIF_F_HW_VLAN_CTAG_RX)
> >  				cam_output |= CAM_OUT_RV;
> > @@ -3432,9 +3431,9 @@ static int ql_request_irq(struct ql_adapter *qdev)
> >  				     &qdev->rx_ring[0]);
> >  			status =
> >  			    request_irq(pdev->irq, qlge_isr,
> > -					test_bit(QL_MSI_ENABLED,
> > -						 &qdev->
> > -						 flags) ? 0 : IRQF_SHARED,
> > +					test_bit(QL_MSI_ENABLED, &qdev->flags)
> > +						? 0
> > +						: IRQF_SHARED,
> >  					intr_context->name, &qdev->rx_ring[0]);
> >  			if (status)
> >  				goto err_irq;
> 

      reply	other threads:[~2020-04-29  4:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  4:04 [PATCH 1/3] staging: qlge: Remove multi-line dereferences from qlge_main.c Rylan Dmello
2020-04-29  4:04 ` [PATCH 2/3] staging: qlge: Fix suspect indentation warning in qlge_main.c Rylan Dmello
2020-04-29  4:04 ` [PATCH 3/3] staging: qlge: Fix function argument alignment " Rylan Dmello
2020-04-29  4:31 ` [PATCH 1/3] staging: qlge: Remove multi-line dereferences from qlge_main.c Joe Perches
2020-04-29  4:55   ` Rylan Dmello [this message]

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=20200429045516.GA2421@athena \
    --to=mail@rylan.coffee \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox