From: Sergey Rozhnov <rozhnov.sergey.89@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
Florian Schilhabel <florian.c.schilhabel@googlemail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8712: Remove redundant braces in if statements
Date: Fri, 21 Jul 2023 06:05:57 +0400 [thread overview]
Message-ID: <ZLnoBYlsTiLixTah@terra> (raw)
Extract masked value to improve readability, apply fix suggested by checkpatch.
---
drivers/staging/rtl8712/ieee80211.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8712/ieee80211.c b/drivers/staging/rtl8712/ieee80211.c
index 7d8f1a29d18a..fe53453ab9a7 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -63,8 +63,9 @@ uint r8712_is_cckrates_included(u8 *rate)
u32 i = 0;
while (rate[i] != 0) {
- if ((((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
- (((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22))
+ u8 val = rate[i] & 0x7f;
+
+ if (val == 2 || val == 4 || val == 11 || val == 22)
return true;
i++;
}
--
2.40.1
next reply other threads:[~2023-07-21 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 2:05 Sergey Rozhnov [this message]
2023-07-21 4:11 ` [PATCH] staging: rtl8712: Remove redundant braces in if statements Greg Kroah-Hartman
2023-07-21 4:57 ` Larry Finger
2023-07-21 6:01 ` Dan Carpenter
2023-07-21 6:34 ` 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=ZLnoBYlsTiLixTah@terra \
--to=rozhnov.sergey.89@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=florian.c.schilhabel@googlemail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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