From: Erick Karanja <karanja99erick@gmail.com>
To: gregkh@linuxfoundation.org, outreachy@lists.linux.dev
Cc: karanja99erick@gmail.com, philipp.g.hortmann@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 6/6] staging: rtl8723bs: Initialize variables at declaration in rtl8723bs_recv.c
Date: Thu, 10 Apr 2025 16:06:11 +0300 [thread overview]
Message-ID: <6acc4efa84d38f5da7cb718d383664832bfb0370.1744285781.git.karanja99erick@gmail.com> (raw)
In-Reply-To: <cover.1744285781.git.karanja99erick@gmail.com>
Make the code more concise and readable by integrating the initialization
directly into the variable declaration in cases where the initialization
is simple and doesn't depend on other variables or complex expressions.
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
---
drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
index 28c914ec2604..8d0d8e8e837e 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_recv.c
@@ -367,14 +367,11 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
*/
s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
{
- s32 res;
+ s32 res = _SUCCESS;
u32 i, n;
- struct recv_priv *precvpriv;
+ struct recv_priv *precvpriv = &padapter->recvpriv;
struct recv_buf *precvbuf;
- res = _SUCCESS;
- precvpriv = &padapter->recvpriv;
-
/* 3 1. init recv buffer */
INIT_LIST_HEAD(&precvpriv->free_recv_buf_queue.queue);
spin_lock_init(&precvpriv->free_recv_buf_queue.lock);
@@ -453,11 +450,9 @@ s32 rtl8723bs_init_recv_priv(struct adapter *padapter)
void rtl8723bs_free_recv_priv(struct adapter *padapter)
{
u32 i;
- struct recv_priv *precvpriv;
+ struct recv_priv *precvpriv = &padapter->recvpriv;
struct recv_buf *precvbuf;
- precvpriv = &padapter->recvpriv;
-
/* 3 1. kill tasklet */
tasklet_kill(&precvpriv->recv_tasklet);
--
2.43.0
prev parent reply other threads:[~2025-04-10 13:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 13:06 [PATCH 0/6] Improve code readability in rtl8723bs module Erick Karanja
2025-04-10 13:06 ` [PATCH 1/6] staging: rtl8723bs: Improve code readability in sdio_ops.c Erick Karanja
2025-04-10 13:06 ` [PATCH 2/6] staging: rtl8723bs: Initialize variables at declaration in odm_HWConfig.c Erick Karanja
2025-04-12 17:36 ` Dan Carpenter
2025-04-10 13:06 ` [PATCH 3/6] staging: rtl8723bs: Initialize variables at declaration in hal_com.c Erick Karanja
2025-04-10 13:06 ` [PATCH 4/6] staging: rtl8723bs: Initialize variables at declaration in sdio_halinit.c Erick Karanja
2025-04-10 13:06 ` [PATCH 5/6] staging: rtl8723bs: Initialize variables at declaration in hal_btcoex.c Erick Karanja
2025-04-10 13:06 ` Erick Karanja [this message]
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=6acc4efa84d38f5da7cb718d383664832bfb0370.1744285781.git.karanja99erick@gmail.com \
--to=karanja99erick@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
--cc=philipp.g.hortmann@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
all inboxes | Powered by JetHome®