From: Hungyu Lin <dennylin0707@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Hungyu Lin <dennylin0707@gmail.com>
Subject: [PATCH] staging: rtl8723bs: remove redundant assignments to res
Date: Sat, 4 Apr 2026 10:09:33 +0000 [thread overview]
Message-ID: <20260404100933.7911-1-dennylin0707@gmail.com> (raw)
The variable res is already equal to _FAIL when the condition
(res == _FAIL) is true. The assignments inside the if blocks are
redundant and can be removed.
No functional change.
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_xmit.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index 7b18be8912e6..ea1923023caa 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -209,10 +209,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitbuf->buf_tag = XMITBUF_MGNT;
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, MAX_XMIT_EXTBUF_SZ + XMITBUF_ALIGN_SZ, true);
- if (res == _FAIL) {
- res = _FAIL;
+ if (res == _FAIL)
goto exit;
- }
pxmitbuf->phead = pxmitbuf->pbuf;
pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMIT_EXTBUF_SZ;
@@ -241,10 +239,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf,
MAX_CMDBUF_SZ + XMITBUF_ALIGN_SZ,
true);
- if (res == _FAIL) {
- res = _FAIL;
+ if (res == _FAIL)
goto exit;
- }
pxmitbuf->phead = pxmitbuf->pbuf;
pxmitbuf->pend = pxmitbuf->pbuf + MAX_CMDBUF_SZ;
--
2.34.1
next reply other threads:[~2026-04-04 10:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 10:09 Hungyu Lin [this message]
2026-04-04 22:35 ` [PATCH] staging: rtl8723bs: remove redundant assignments to res Ethan Tidmore
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=20260404100933.7911-1-dennylin0707@gmail.com \
--to=dennylin0707@gmail.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