From: Joe Perches <joe@perches.com>
To: dev.dragon@bk.ru, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: wimax: i2400m: fixing several coding style issues.
Date: Sun, 31 Jan 2021 20:16:58 -0800 [thread overview]
Message-ID: <fb815f4d3d75cdb10add70378de1271bc8d6297e.camel@perches.com> (raw)
In-Reply-To: <20210131204250.112299-1-dev.dragon@bk.ru>
On Sun, 2021-01-31 at 23:42 +0300, dev.dragon@bk.ru wrote:
> diff --git a/drivers/staging/wimax/i2400m/rx.c b/drivers/staging/wimax/i2400m/rx.c
[]
> @@ -764,9 +763,9 @@ unsigned __i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
> new_nws);
> __skb_unlink(skb_itr, &roq->queue);
> i2400m_net_erx(i2400m, skb_itr, roq_data_itr->cs);
> - }
> - else
> + } else {
> break; /* rest of packets all nsn_itr > nws */
> + }
> }
Rather than merely fixing what checkpatch complains about, it'd be
better to reverse the test above and break directly then unindent
the expected block.
---
drivers/staging/wimax/i2400m/rx.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/wimax/i2400m/rx.c b/drivers/staging/wimax/i2400m/rx.c
index c9fb619a9e01..caeba9694b4e 100644
--- a/drivers/staging/wimax/i2400m/rx.c
+++ b/drivers/staging/wimax/i2400m/rx.c
@@ -757,16 +757,12 @@ unsigned __i2400m_roq_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
roq_data_itr = (struct i2400m_roq_data *) &skb_itr->cb;
nsn_itr = __i2400m_roq_nsn(roq, roq_data_itr->sn);
/* NSN bounds assumed correct (checked when it was queued) */
- if (nsn_itr < new_nws) {
- d_printf(2, dev, "ERX: roq %p - release skb %p "
- "(nsn %u/%u new nws %u)\n",
- roq, skb_itr, nsn_itr, roq_data_itr->sn,
- new_nws);
- __skb_unlink(skb_itr, &roq->queue);
- i2400m_net_erx(i2400m, skb_itr, roq_data_itr->cs);
- }
- else
- break; /* rest of packets all nsn_itr > nws */
+ if (nsn_itr >= new_nws)
+ break;
+ d_printf(2, dev, "ERX: roq %p - release skb %p (nsn %u/%u new nws %u)\n",
+ roq, skb_itr, nsn_itr, roq_data_itr->sn, new_nws);
+ __skb_unlink(skb_itr, &roq->queue);
+ i2400m_net_erx(i2400m, skb_itr, roq_data_itr->cs);
}
roq->ws = sn;
return new_nws;
next prev parent reply other threads:[~2021-02-01 4:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-31 20:42 dev.dragon
2021-02-01 4:16 ` Joe Perches [this message]
2021-02-07 19:11 ` [96e8740] [PATCH 2/2] Staging: wimax: i2400m: some readability improvements dev.dragon
2021-02-08 6:49 ` Greg KH
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=fb815f4d3d75cdb10add70378de1271bc8d6297e.camel@perches.com \
--to=joe@perches.com \
--cc=dev.dragon@bk.ru \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®