From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Michael Straube <straube.linux@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 3/8] staging: r8188eu: remove two checks that are always false
Date: Sat, 16 Oct 2021 13:30:03 +0200 [thread overview]
Message-ID: <20211016113008.27549-4-martin@kaiser.cx> (raw)
In-Reply-To: <20211016113008.27549-1-martin@kaiser.cx>
Commit aefb1fc5c185 ("staging: r8188eu: odm BoardType is never set")
clarified that the odm board type is always 0.
The CheckCondition functions extract the board type from the hex
parameter and stores it in _board. For _board == 0,
(_board == cond) && cond != 0x00 is always false. Remove the checks.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/staging/r8188eu/hal/HalHWImg8188E_BB.c | 5 -----
drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c | 5 -----
2 files changed, 10 deletions(-)
diff --git a/drivers/staging/r8188eu/hal/HalHWImg8188E_BB.c b/drivers/staging/r8188eu/hal/HalHWImg8188E_BB.c
index a623e0aaa0d0..f6e4243e0c7b 100644
--- a/drivers/staging/r8188eu/hal/HalHWImg8188E_BB.c
+++ b/drivers/staging/r8188eu/hal/HalHWImg8188E_BB.c
@@ -13,7 +13,6 @@
static bool CheckCondition(const u32 condition, const u32 hex)
{
- u32 _board = (hex & 0x000000FF);
u32 _interface = (hex & 0x0000FF00) >> 8;
u32 _platform = (hex & 0x00FF0000) >> 16;
u32 cond = condition;
@@ -21,10 +20,6 @@ static bool CheckCondition(const u32 condition, const u32 hex)
if (condition == 0xCDCDCDCD)
return true;
- cond = condition & 0x000000FF;
- if ((_board == cond) && cond != 0x00)
- return false;
-
cond = condition & 0x0000FF00;
cond = cond >> 8;
if ((_interface & cond) == 0 && cond != 0x07)
diff --git a/drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c b/drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c
index 3e2a09fc2619..5e0a96200078 100644
--- a/drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c
+++ b/drivers/staging/r8188eu/hal/HalHWImg8188E_RF.c
@@ -6,7 +6,6 @@
static bool CheckCondition(const u32 Condition, const u32 Hex)
{
- u32 _board = (Hex & 0x000000FF);
u32 _interface = (Hex & 0x0000FF00) >> 8;
u32 _platform = (Hex & 0x00FF0000) >> 16;
u32 cond = Condition;
@@ -14,10 +13,6 @@ static bool CheckCondition(const u32 Condition, const u32 Hex)
if (Condition == 0xCDCDCDCD)
return true;
- cond = Condition & 0x000000FF;
- if ((_board == cond) && cond != 0x00)
- return false;
-
cond = Condition & 0x0000FF00;
cond = cond >> 8;
if ((_interface & cond) == 0 && cond != 0x07)
--
2.20.1
next prev parent reply other threads:[~2021-10-16 11:30 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-16 11:30 [PATCH 0/8] staging: r8188eu: another round of removals Martin Kaiser
2021-10-16 11:30 ` [PATCH 1/8] staging: r8188eu: remove empty trigger gpio code Martin Kaiser
2021-10-17 11:23 ` Michael Straube
2021-10-16 11:30 ` [PATCH 2/8] staging: r8188eu: interface type is always usb Martin Kaiser
2021-10-17 11:46 ` Michael Straube
2021-10-16 11:30 ` Martin Kaiser [this message]
2021-10-17 11:48 ` [PATCH 3/8] staging: r8188eu: remove two checks that are always false Michael Straube
2021-10-16 11:30 ` [PATCH 4/8] staging: r8188eu: remove unused function prototypes Martin Kaiser
2021-10-17 11:50 ` Michael Straube
2021-10-16 11:30 ` [PATCH 5/8] staging: r8188eu: PHY_SetRFPathSwitch_8188E is not used Martin Kaiser
2021-10-17 11:53 ` Michael Straube
2021-10-16 11:30 ` [PATCH 6/8] staging: r8188eu: clean up Hal8188EPhyCfg.h Martin Kaiser
2021-10-17 11:54 ` Michael Straube
2021-10-16 11:30 ` [PATCH 7/8] staging: r8188eu: remove procfs functions Martin Kaiser
2021-10-17 11:56 ` Michael Straube
2021-10-16 11:30 ` [PATCH 8/8] staging: r8188eu: CurrentWirelessMode is not used Martin Kaiser
2021-10-17 11:57 ` Michael Straube
2021-10-16 15:34 ` [PATCH 0/8] staging: r8188eu: another round of removals Phillip Potter
2021-10-16 16:33 ` Martin Kaiser
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=20211016113008.27549-4-martin@kaiser.cx \
--to=martin@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.com \
/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