From: Ojaswin Mujoo <ojaswin98@gmail.com>
To: linux-staging@lists.linux.dev
Cc: linux-kernel@vger.kernel.org, ojaswin98@gmail.com,
gregkh@linuxfoundation.org, atulgopinathan@gmail.com,
yashsri421@gmail.com
Subject: [PATCH 1/3] staging: rtl8192e: Avoid multiple line dereference
Date: Mon, 10 May 2021 17:01:01 +0530 [thread overview]
Message-ID: <435b60bd8874f8105b4af6e7eb9ee5bdbfe3112f.1620642396.git.ojaswin98@gmail.com> (raw)
In-Reply-To: <cover.1620642396.git.ojaswin98@gmail.com>
Avoid multiple line dereference to make the code more readable, as
suggested by checkpatch.pl
This patch fixes the following checkpatch.pl warning:
- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:189
- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:195
- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:204
- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:209
- WARNING: Avoid multiple line dereference
prefer 'info_element->data[info_element->len]'
FILE: ./rtl8192e/rtllib_rx.c:2287
Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
---
These changes cause some of the lines to cross 80 characters however I
believe that they improve the readability and provide a good trade off.
Would love to hear your thoughts and suggestions on this.
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 12 ++++--------
drivers/staging/rtl8192e/rtllib_rx.c | 3 +--
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
index c8506517cc8d..f75a12543781 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
@@ -185,14 +185,12 @@ void rtl92e_cam_restore(struct net_device *dev)
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
(u8 *)dev->dev_addr, 0,
- (u32 *)(&priv->rtllib->swcamtable[4].
- key_buf[0]));
+ (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
} else {
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
MacAddr, 0,
- (u32 *)(&priv->rtllib->swcamtable[4].
- key_buf[0]));
+ (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
}
} else if (priv->rtllib->pairwise_key_type == KEY_TYPE_CCMP) {
@@ -200,13 +198,11 @@ void rtl92e_cam_restore(struct net_device *dev)
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type,
(u8 *)dev->dev_addr, 0,
- (u32 *)(&priv->rtllib->swcamtable[4].
- key_buf[0]));
+ (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
} else {
rtl92e_set_key(dev, 4, 0,
priv->rtllib->pairwise_key_type, MacAddr,
- 0, (u32 *)(&priv->rtllib->swcamtable[4].
- key_buf[0]));
+ 0, (u32 *)(&priv->rtllib->swcamtable[4].key_buf[0]));
}
}
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 15bbb63ca130..16931a4fae5d 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2283,8 +2283,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
length -= sizeof(*info_element) + info_element->len;
info_element =
- (struct rtllib_info_element *)&info_element->
- data[info_element->len];
+ (struct rtllib_info_element *)&info_element->data[info_element->len];
}
if (!network->atheros_cap_exist && !network->broadcom_cap_exist &&
--
2.25.1
next prev parent reply other threads:[~2021-05-10 12:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 11:29 [PATCH 0/3] staging: rtl8192e: Fix style warnings in rtl8192e driver Ojaswin Mujoo
2021-05-10 11:31 ` Ojaswin Mujoo [this message]
2021-05-10 11:34 ` [PATCH 2/3] staging: rtl8192e: Add identifier name to function definition Ojaswin Mujoo
2021-05-10 11:35 ` [PATCH 3/3] staging: rtl8192e: Fix whitespace around conditional statement Ojaswin Mujoo
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=435b60bd8874f8105b4af6e7eb9ee5bdbfe3112f.1620642396.git.ojaswin98@gmail.com \
--to=ojaswin98@gmail.com \
--cc=atulgopinathan@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=yashsri421@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®