From: Yihao Han <hanyihao@vivo.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Fabio Aiuto <fabioaiuto83@gmail.com>,
Yihao Han <hanyihao@vivo.com>, Lee Jones <lee.jones@linaro.org>,
Xiangyang Zhang <xyz.sun.ok@gmail.com>,
"Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
Bryan Brattlof <hello@bryanbrattlof.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: kernel@vivo.com
Subject: [PATCH v2] staging: rtl8723bs: remove unnecessary `if`
Date: Fri, 8 Apr 2022 06:59:11 -0700 [thread overview]
Message-ID: <20220408135921.16534-1-hanyihao@vivo.com> (raw)
In-Reply-To: <20220408085158.GS3293@kadam>
remove a unnecesarry if in `sd_recv_rxfifo`
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
drivers/staging/rtl8723bs/hal/sdio_ops.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c
index a545832a468e..107f427ee4aa 100755
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
@@ -811,17 +811,14 @@ static struct recv_buf *sd_recv_rxfifo(struct adapter *adapter, u32 size)
SIZE_PTR alignment = 0;
recvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
-
- if (recvbuf->pskb) {
- recvbuf->pskb->dev = adapter->pnetdev;
-
- tmpaddr = (SIZE_PTR)recvbuf->pskb->data;
- alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
- skb_reserve(recvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
- }
-
if (!recvbuf->pskb)
return NULL;
+
+ recvbuf->pskb->dev = adapter->pnetdev;
+
+ tmpaddr = (SIZE_PTR)recvbuf->pskb->data;
+ alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
+ skb_reserve(recvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
}
/* 3 3. read data from rxfifo */
--
2.17.1
next prev parent reply other threads:[~2022-04-08 13:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 7:42 [PATCH] staging: rtl8723bs: simplify if-if to if-else Yihao Han
2022-04-08 8:51 ` Dan Carpenter
2022-04-08 13:59 ` Yihao Han [this message]
2022-04-08 14:12 ` [PATCH v2] staging: rtl8723bs: remove unnecessary `if` Dan Carpenter
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=20220408135921.16534-1-hanyihao@vivo.com \
--to=hanyihao@vivo.com \
--cc=fabioaiuto83@gmail.com \
--cc=fmdefrancesco@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hello@bryanbrattlof.com \
--cc=kernel@vivo.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=xyz.sun.ok@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;
as well as URLs for NNTP newsgroup(s).