From: binyi <dantengknight@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Manish Chopra <manishc@marvell.com>,
GR-Linux-NIC-Dev@marvell.com, Coiby Xu <coiby.xu@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: qlge: Fix indentation issue under long for loop
Date: Sun, 10 Jul 2022 13:55:12 -0700 [thread overview]
Message-ID: <20220710205512.GA1883@cloud-MacBookPro> (raw)
In-Reply-To: <d278cf5d38235db92efa236cb1940a67e0e9a005.camel@perches.com>
On Sun, Jul 10, 2022 at 08:28:57AM -0700, Joe Perches wrote:
> On Sun, 2022-07-10 at 01:36 -0700, Binyi Han wrote:
> > Fix indentation issue to adhere to Linux kernel coding style,
> > Issue found by checkpatch. And change the long for loop into 3 lines.
> >
> > Signed-off-by: Binyi Han <dantengknight@gmail.com>
> > ---
> > v2:
> > - Change the long for loop into 3 lines.
> >
> > drivers/staging/qlge/qlge_main.c | 18 ++++++++++--------
> > 1 file changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> > index 1a378330d775..6e771d0e412b 100644
> > --- a/drivers/staging/qlge/qlge_main.c
> > +++ b/drivers/staging/qlge/qlge_main.c
> > @@ -3007,10 +3007,11 @@ static int qlge_start_rx_ring(struct qlge_adapter *qdev, struct rx_ring *rx_ring
> > tmp = (u64)rx_ring->lbq.base_dma;
> > base_indirect_ptr = rx_ring->lbq.base_indirect;
> >
> > - for (page_entries = 0; page_entries <
> > - MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN); page_entries++)
> > - base_indirect_ptr[page_entries] =
> > - cpu_to_le64(tmp + (page_entries * DB_PAGE_SIZE));
> > + for (page_entries = 0;
> > + page_entries < MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN);
> > + page_entries++)
> > + base_indirect_ptr[page_entries] =
> > + cpu_to_le64(tmp + (page_entries * DB_PAGE_SIZE));
>
> Better to align page_entries to the open parenthesis.
>
> And another optimization would be to simply add DB_PAGE_SIZE to tmp
> in the loop and avoid the multiply.
>
> for (page_entries = 0;
> page_entries < MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN);
> page_entries++) {
> base_indirect_ptr[page_entries] = cpu_to_le64(tmp);
> tmp += DB_PAGE_SIZE;
> }
>
> > @@ -3022,10 +3023,11 @@ static int qlge_start_rx_ring(struct qlge_adapter *qdev, struct rx_ring *rx_ring
> > tmp = (u64)rx_ring->sbq.base_dma;
> > base_indirect_ptr = rx_ring->sbq.base_indirect;
> >
> > - for (page_entries = 0; page_entries <
> > - MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN); page_entries++)
> > - base_indirect_ptr[page_entries] =
> > - cpu_to_le64(tmp + (page_entries * DB_PAGE_SIZE));
> > + for (page_entries = 0;
> > + page_entries < MAX_DB_PAGES_PER_BQ(QLGE_BQ_LEN);
> > + page_entries++)
> > + base_indirect_ptr[page_entries] =
> > + cpu_to_le64(tmp + (page_entries * DB_PAGE_SIZE));
>
> here too
>
Ah I see, that makes sense. Thanks for reviewing!
prev parent reply other threads:[~2022-07-10 20:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-10 8:36 [PATCH v2] staging: qlge: Fix indentation issue under long for loop Binyi Han
2022-07-10 15:28 ` Joe Perches
2022-07-10 20:55 ` binyi [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=20220710205512.GA1883@cloud-MacBookPro \
--to=dantengknight@gmail.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=coiby.xu@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--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.