* [PATCH 1/2] staging: ks7010: Unnecessary parentheses are removed to make coder nicer.
@ 2017-02-19 21:57 Arushi Singhal
2017-02-20 7:25 ` kbuild test robot
0 siblings, 1 reply; 2+ messages in thread
From: Arushi Singhal @ 2017-02-19 21:57 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel, outreachy-kernel
Unnecessary parentheses should be avoided as reported by checkpatch.pl.
Remove unnecessary parentheses, as reported by checkpatch as are nicer
to read.For example:-
It's often nicer to read if &(foo[0]) is converted to foo like:
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
drivers/staging/ks7010/ks_hostif.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 1fbd495e5e63..ba283ab741a7 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -113,7 +113,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
int rc = 0;
DPRINTK(3, "\n");
- ap = &(priv->current_ap);
+ ap = priv->current_ap;
if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS) {
memset(ap, 0, sizeof(struct local_ap_t));
@@ -121,19 +121,19 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
}
/* bssid */
- memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
+ memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
/* essid */
- memcpy(&(ap->ssid.body[0]), &(priv->reg.ssid.body[0]),
+ memcpy(ap->ssid.body, priv->reg.ssid.body,
priv->reg.ssid.size);
ap->ssid.size = priv->reg.ssid.size;
/* rate_set */
- memcpy(&(ap->rate_set.body[0]), &(ap_info->rate_set.body[0]),
+ memcpy(ap->rate_set.body, ap_info->rate_set.body,
ap_info->rate_set.size);
ap->rate_set.size = ap_info->rate_set.size;
if (ap_info->ext_rate_set.size) {
/* rate_set */
- memcpy(&(ap->rate_set.body[ap->rate_set.size]),
- &(ap_info->ext_rate_set.body[0]),
+ memcpy(&ap->rate_set.body[ap->rate_set.size],
+ ap_info->ext_rate_set.body,
ap_info->ext_rate_set.size);
ap->rate_set.size += ap_info->ext_rate_set.size;
}
@@ -153,11 +153,11 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
ap->rsn_ie.id = 0x30;
if (ap_info->rsn.size <= RSN_IE_BODY_MAX) {
ap->rsn_ie.size = ap_info->rsn.size;
- memcpy(&(ap->rsn_ie.body[0]), &(ap_info->rsn.body[0]),
+ memcpy(ap->rsn_ie.body, ap_info->rsn.body,
ap_info->rsn.size);
} else {
ap->rsn_ie.size = RSN_IE_BODY_MAX;
- memcpy(&(ap->rsn_ie.body[0]), &(ap_info->rsn.body[0]),
+ memcpy(ap->rsn_ie.body, ap_info->rsn.body,
RSN_IE_BODY_MAX);
}
} else if ((ap_info->rsn_mode & RSN_MODE_WPA)
@@ -165,11 +165,11 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
ap->wpa_ie.id = 0xdd;
if (ap_info->rsn.size <= RSN_IE_BODY_MAX) {
ap->wpa_ie.size = ap_info->rsn.size;
- memcpy(&(ap->wpa_ie.body[0]), &(ap_info->rsn.body[0]),
+ memcpy(ap->wpa_ie.body, ap_info->rsn.body,
ap_info->rsn.size);
} else {
ap->wpa_ie.size = RSN_IE_BODY_MAX;
- memcpy(&(ap->wpa_ie.body[0]), &(ap_info->rsn.body[0]),
+ memcpy(ap->wpa_ie.body, ap_info->rsn.body,
RSN_IE_BODY_MAX);
}
} else {
@@ -212,7 +212,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
memset(ap, 0, sizeof(struct local_ap_t));
/* bssid */
- memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN);
+ memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
/* rssi */
ap->rssi = ap_info->rssi;
/* sq */
@@ -224,7 +224,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
/* channel */
ap->channel = ap_info->ch_info;
- bp = &(ap_info->body[0]);
+ bp = ap_info->body;
bsize = ap_info->body_size;
offset = 0;
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] staging: ks7010: Unnecessary parentheses are removed to make coder nicer.
2017-02-19 21:57 [PATCH 1/2] staging: ks7010: Unnecessary parentheses are removed to make coder nicer Arushi Singhal
@ 2017-02-20 7:25 ` kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2017-02-20 7:25 UTC (permalink / raw)
To: Arushi Singhal; +Cc: kbuild-all, gregkh, devel, outreachy-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]
Hi Arushi,
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.10 next-20170217]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Arushi-Singhal/staging-ks7010-Unnecessary-parentheses-are-removed-to-make-coder-nicer/20170220-145647
config: i386-randconfig-x012-201708 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers/staging/ks7010/ks_hostif.c: In function 'get_current_ap':
>> drivers/staging/ks7010/ks_hostif.c:116:5: error: incompatible types when assigning to type 'struct local_ap_t *' from type 'struct local_ap_t'
ap = priv->current_ap;
^
vim +116 drivers/staging/ks7010/ks_hostif.c
110 struct local_ap_t *ap;
111 union iwreq_data wrqu;
112 struct net_device *netdev = priv->net_dev;
113 int rc = 0;
114
115 DPRINTK(3, "\n");
> 116 ap = priv->current_ap;
117
118 if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS) {
119 memset(ap, 0, sizeof(struct local_ap_t));
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27058 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-20 7:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-19 21:57 [PATCH 1/2] staging: ks7010: Unnecessary parentheses are removed to make coder nicer Arushi Singhal
2017-02-20 7:25 ` kbuild test robot
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®