Commit 1935c145 authored by Arushi Singhal's avatar Arushi Singhal Committed by Greg Kroah-Hartman

staging: ks7010: Unnecessary parentheses removed and improved coding style.

Unnecessary parentheses are removed as reported by checkpatch.pl
to make coder nicer and to improve readability.
Also coding style is improved as 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: default avatarArushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eb1397d1
...@@ -113,7 +113,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info) ...@@ -113,7 +113,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
int rc = 0; int rc = 0;
DPRINTK(3, "\n"); DPRINTK(3, "\n");
ap = &(priv->current_ap); ap = &priv->current_ap;
if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS) { if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS) {
memset(ap, 0, sizeof(struct local_ap_t)); 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) ...@@ -121,19 +121,19 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
} }
/* bssid */ /* bssid */
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN); memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
/* essid */ /* essid */
memcpy(&(ap->ssid.body[0]), &(priv->reg.ssid.body[0]), memcpy(ap->ssid.body, priv->reg.ssid.body,
priv->reg.ssid.size); priv->reg.ssid.size);
ap->ssid.size = priv->reg.ssid.size; ap->ssid.size = priv->reg.ssid.size;
/* rate_set */ /* 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_info->rate_set.size);
ap->rate_set.size = ap_info->rate_set.size; ap->rate_set.size = ap_info->rate_set.size;
if (ap_info->ext_rate_set.size) { if (ap_info->ext_rate_set.size) {
/* rate_set */ /* rate_set */
memcpy(&(ap->rate_set.body[ap->rate_set.size]), memcpy(&ap->rate_set.body[ap->rate_set.size],
&(ap_info->ext_rate_set.body[0]), ap_info->ext_rate_set.body,
ap_info->ext_rate_set.size); ap_info->ext_rate_set.size);
ap->rate_set.size += 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) ...@@ -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; ap->rsn_ie.id = 0x30;
if (ap_info->rsn.size <= RSN_IE_BODY_MAX) { if (ap_info->rsn.size <= RSN_IE_BODY_MAX) {
ap->rsn_ie.size = ap_info->rsn.size; 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); ap_info->rsn.size);
} else { } else {
ap->rsn_ie.size = RSN_IE_BODY_MAX; 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); RSN_IE_BODY_MAX);
} }
} else if ((ap_info->rsn_mode & RSN_MODE_WPA) } 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) ...@@ -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; ap->wpa_ie.id = 0xdd;
if (ap_info->rsn.size <= RSN_IE_BODY_MAX) { if (ap_info->rsn.size <= RSN_IE_BODY_MAX) {
ap->wpa_ie.size = ap_info->rsn.size; 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); ap_info->rsn.size);
} else { } else {
ap->wpa_ie.size = RSN_IE_BODY_MAX; 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); RSN_IE_BODY_MAX);
} }
} else { } else {
...@@ -184,7 +184,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info) ...@@ -184,7 +184,7 @@ int get_current_ap(struct ks_wlan_private *priv, struct link_ap_info_t *ap_info)
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) { if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
memcpy(wrqu.ap_addr.sa_data, memcpy(wrqu.ap_addr.sa_data,
&(priv->current_ap.bssid[0]), ETH_ALEN); priv->current_ap.bssid, ETH_ALEN);
DPRINTK(3, DPRINTK(3,
"IWEVENT: connect bssid=%pM\n", wrqu.ap_addr.sa_data); "IWEVENT: connect bssid=%pM\n", wrqu.ap_addr.sa_data);
wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
...@@ -212,7 +212,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ...@@ -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)); memset(ap, 0, sizeof(struct local_ap_t));
/* bssid */ /* bssid */
memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_ALEN); memcpy(ap->bssid, ap_info->bssid, ETH_ALEN);
/* rssi */ /* rssi */
ap->rssi = ap_info->rssi; ap->rssi = ap_info->rssi;
/* sq */ /* sq */
...@@ -224,7 +224,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ...@@ -224,7 +224,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
/* channel */ /* channel */
ap->channel = ap_info->ch_info; ap->channel = ap_info->ch_info;
bp = &(ap_info->body[0]); bp = ap_info->body;
bsize = ap_info->body_size; bsize = ap_info->body_size;
offset = 0; offset = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment