From: Saurav Girepunje <saurav.girepunje@gmail.com>
To: gregkh@linuxfoundation.org, kuba@kernel.org,
lee.jones@linaro.org, saurav.girepunje@gmail.com,
nathan@kernel.org, clrrm@isep.ipp.pt, johan@kernel.org,
dinghao.liu@zju.edu.cn, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: saurav.girepunje@hotmail.com
Subject: [PATCH] staging: rtl8192u: remove the if condition without effect
Date: Mon, 8 Nov 2021 09:41:22 +0530 [thread overview]
Message-ID: <YYijapuGOmObwM3S@Sauravs-MacBook-Air.local> (raw)
In function rtl8192_adapter_start priv->pFirmware->firmware_status
is assign to FW_STATUS_0_INIT just after assignment variable is
again get check for same value. Therefore if condition will be
always be true. So remove the if condition ,else if section and
else section which will never get execute.
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
---
drivers/staging/rtl8192u/r8192U_core.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 726d7ad9408b..f5d9e81f4ac7 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2666,14 +2666,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)
/* config CPUReset Register */
/* Firmware Reset or not? */
read_nic_dword(dev, CPU_GEN, &dwRegRead);
- if (priv->pFirmware->firmware_status == FW_STATUS_0_INIT)
- dwRegRead |= CPU_GEN_SYSTEM_RESET; /* do nothing here? */
- else if (priv->pFirmware->firmware_status == FW_STATUS_5_READY)
- dwRegRead |= CPU_GEN_FIRMWARE_RESET;
- else
- RT_TRACE(COMP_ERR,
- "ERROR in %s(): undefined firmware state(%d)\n",
- __func__, priv->pFirmware->firmware_status);
+ dwRegRead |= CPU_GEN_SYSTEM_RESET; /* do nothing here? */
write_nic_dword(dev, CPU_GEN, dwRegRead);
/* config BB. */
--
2.33.0
next reply other threads:[~2021-11-08 4:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 4:11 Saurav Girepunje [this message]
2021-11-08 4:15 ` [PATCH] staging: rtl8192u: remove the if condition without effect Saurav Girepunje
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=YYijapuGOmObwM3S@Sauravs-MacBook-Air.local \
--to=saurav.girepunje@gmail.com \
--cc=clrrm@isep.ipp.pt \
--cc=dinghao.liu@zju.edu.cn \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=kuba@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=saurav.girepunje@hotmail.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;
as well as URLs for NNTP newsgroup(s).