Commit be046617 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 915e70f9
...@@ -239,19 +239,19 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ...@@ -239,19 +239,19 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
*(bp + 1)); *(bp + 1));
ap->ssid.size = SSID_MAX_SIZE; ap->ssid.size = SSID_MAX_SIZE;
} }
memcpy(&(ap->ssid.body[0]), bp + 2, ap->ssid.size); memcpy(ap->ssid.body, bp + 2, ap->ssid.size);
break; break;
case 1: /* rate */ case 1: /* rate */
case 50: /* ext rate */ case 50: /* ext rate */
if ((*(bp + 1) + ap->rate_set.size) <= if ((*(bp + 1) + ap->rate_set.size) <=
RATE_SET_MAX_SIZE) { RATE_SET_MAX_SIZE) {
memcpy(&(ap->rate_set.body[ap->rate_set.size]), memcpy(&ap->rate_set.body[ap->rate_set.size],
bp + 2, *(bp + 1)); bp + 2, *(bp + 1));
ap->rate_set.size += *(bp + 1); ap->rate_set.size += *(bp + 1);
} else { } else {
DPRINTK(1, "size over :: rate size=%d\n", DPRINTK(1, "size over :: rate size=%d\n",
(*(bp + 1) + ap->rate_set.size)); (*(bp + 1) + ap->rate_set.size));
memcpy(&(ap->rate_set.body[ap->rate_set.size]), memcpy(&ap->rate_set.body[ap->rate_set.size],
bp + 2, bp + 2,
RATE_SET_MAX_SIZE - ap->rate_set.size); RATE_SET_MAX_SIZE - ap->rate_set.size);
ap->rate_set.size += ap->rate_set.size +=
...@@ -269,7 +269,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ...@@ -269,7 +269,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
*(bp + 1)); *(bp + 1));
ap->rsn_ie.size = RSN_IE_BODY_MAX; ap->rsn_ie.size = RSN_IE_BODY_MAX;
} }
memcpy(&(ap->rsn_ie.body[0]), bp + 2, ap->rsn_ie.size); memcpy(ap->rsn_ie.body, bp + 2, ap->rsn_ie.size);
break; break;
case 221: /* WPA */ case 221: /* WPA */
if (!memcmp(bp + 2, "\x00\x50\xf2\x01", 4)) { /* WPA OUI check */ if (!memcmp(bp + 2, "\x00\x50\xf2\x01", 4)) { /* WPA OUI check */
...@@ -282,7 +282,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info, ...@@ -282,7 +282,7 @@ int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
*(bp + 1)); *(bp + 1));
ap->wpa_ie.size = RSN_IE_BODY_MAX; ap->wpa_ie.size = RSN_IE_BODY_MAX;
} }
memcpy(&(ap->wpa_ie.body[0]), bp + 2, memcpy(ap->wpa_ie.body, bp + 2,
ap->wpa_ie.size); ap->wpa_ie.size);
} }
break; break;
...@@ -828,13 +828,12 @@ void hostif_scan_indication(struct ks_wlan_private *priv) ...@@ -828,13 +828,12 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
if (priv->scan_ind_count != 0) { if (priv->scan_ind_count != 0) {
for (i = 0; i < priv->aplist.size; i++) { /* bssid check */ for (i = 0; i < priv->aplist.size; i++) { /* bssid check */
if (!memcmp if (!memcmp
(&(ap_info->bssid[0]), (ap_info->bssid,
&(priv->aplist.ap[i].bssid[0]), ETH_ALEN)) { priv->aplist.ap[i].bssid, ETH_ALEN)) {
if (ap_info->frame_type == if (ap_info->frame_type ==
FRAME_TYPE_PROBE_RESP) FRAME_TYPE_PROBE_RESP)
get_ap_information(priv, ap_info, get_ap_information(priv, ap_info,
&(priv->aplist. &priv->aplist.ap[i]);
ap[i]));
return; return;
} }
} }
...@@ -2639,7 +2638,7 @@ int hostif_init(struct ks_wlan_private *priv) ...@@ -2639,7 +2638,7 @@ int hostif_init(struct ks_wlan_private *priv)
priv->aplist.size = 0; priv->aplist.size = 0;
for (i = 0; i < LOCAL_APLIST_MAX; i++) for (i = 0; i < LOCAL_APLIST_MAX; i++)
memset(&(priv->aplist.ap[i]), 0, sizeof(struct local_ap_t)); memset(&priv->aplist.ap[i], 0, sizeof(struct local_ap_t));
priv->infra_status = 0; priv->infra_status = 0;
priv->current_rate = 4; priv->current_rate = 4;
priv->connect_status = DISCONNECT_STATUS; priv->connect_status = DISCONNECT_STATUS;
...@@ -2662,12 +2661,12 @@ int hostif_init(struct ks_wlan_private *priv) ...@@ -2662,12 +2661,12 @@ int hostif_init(struct ks_wlan_private *priv)
INIT_WORK(&priv->ks_wlan_wakeup_task, ks_wlan_hw_wakeup_task); INIT_WORK(&priv->ks_wlan_wakeup_task, ks_wlan_hw_wakeup_task);
/* WPA */ /* WPA */
memset(&(priv->wpa), 0, sizeof(priv->wpa)); memset(&priv->wpa, 0, sizeof(priv->wpa));
priv->wpa.rsn_enabled = 0; priv->wpa.rsn_enabled = 0;
priv->wpa.mic_failure.failure = 0; priv->wpa.mic_failure.failure = 0;
priv->wpa.mic_failure.last_failure_time = 0; priv->wpa.mic_failure.last_failure_time = 0;
priv->wpa.mic_failure.stop = 0; priv->wpa.mic_failure.stop = 0;
memset(&(priv->pmklist), 0, sizeof(priv->pmklist)); memset(&priv->pmklist, 0, sizeof(priv->pmklist));
INIT_LIST_HEAD(&priv->pmklist.head); INIT_LIST_HEAD(&priv->pmklist.head);
for (i = 0; i < PMK_LIST_MAX; i++) for (i = 0; i < PMK_LIST_MAX; i++)
INIT_LIST_HEAD(&priv->pmklist.pmk[i].list); INIT_LIST_HEAD(&priv->pmklist.pmk[i].list);
......
...@@ -421,7 +421,7 @@ static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info, ...@@ -421,7 +421,7 @@ static int ks_wlan_get_wap(struct net_device *dev, struct iw_request_info *info,
/* for SLEEP MODE */ /* for SLEEP MODE */
if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS)
memcpy(awrq->sa_data, &(priv->current_ap.bssid[0]), ETH_ALEN); memcpy(awrq->sa_data, priv->current_ap.bssid, ETH_ALEN);
else else
eth_zero_addr(awrq->sa_data); eth_zero_addr(awrq->sa_data);
...@@ -1455,7 +1455,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev, ...@@ -1455,7 +1455,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
iwe.u.data.flags = 1; iwe.u.data.flags = 1;
current_ev = current_ev =
iwe_stream_add_point(info, current_ev, end_buf, &iwe, iwe_stream_add_point(info, current_ev, end_buf, &iwe,
&(ap->ssid.body[0])); ap->ssid.body);
/* Add mode */ /* Add mode */
iwe.cmd = SIOCGIWMODE; iwe.cmd = SIOCGIWMODE;
...@@ -1497,7 +1497,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev, ...@@ -1497,7 +1497,7 @@ static inline char *ks_wlan_translate_scan(struct net_device *dev,
iwe.u.data.length = 0; iwe.u.data.length = 0;
current_ev = current_ev =
iwe_stream_add_point(info, current_ev, end_buf, &iwe, iwe_stream_add_point(info, current_ev, end_buf, &iwe,
&(ap->ssid.body[0])); ap->ssid.body);
/* Rate : stuffing multiple values in a single event require a bit /* Rate : stuffing multiple values in a single event require a bit
* more of magic - Jean II */ * more of magic - Jean II */
...@@ -1613,7 +1613,7 @@ static int ks_wlan_get_scan(struct net_device *dev, ...@@ -1613,7 +1613,7 @@ static int ks_wlan_get_scan(struct net_device *dev,
current_ev = ks_wlan_translate_scan(dev, current_ev, current_ev = ks_wlan_translate_scan(dev, current_ev,
// extra + IW_SCAN_MAX_DATA, // extra + IW_SCAN_MAX_DATA,
extra + dwrq->length, extra + dwrq->length,
&(priv->current_ap)); &priv->current_ap);
} }
#endif #endif
/* Read and parse all entries */ /* Read and parse all entries */
...@@ -1626,7 +1626,7 @@ static int ks_wlan_get_scan(struct net_device *dev, ...@@ -1626,7 +1626,7 @@ static int ks_wlan_get_scan(struct net_device *dev,
current_ev = ks_wlan_translate_scan(dev, info, current_ev, current_ev = ks_wlan_translate_scan(dev, info, current_ev,
// extra + IW_SCAN_MAX_DATA, // extra + IW_SCAN_MAX_DATA,
extra + dwrq->length, extra + dwrq->length,
&(priv->aplist.ap[i])); &priv->aplist.ap[i]);
} }
/* Length of data */ /* Length of data */
dwrq->length = (current_ev - extra); dwrq->length = (current_ev - extra);
...@@ -2082,7 +2082,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev, ...@@ -2082,7 +2082,7 @@ static int ks_wlan_set_pmksa(struct net_device *dev,
} }
break; break;
case IW_PMKSA_FLUSH: case IW_PMKSA_FLUSH:
memset(&(priv->pmklist), 0, sizeof(priv->pmklist)); memset(&priv->pmklist, 0, sizeof(priv->pmklist));
INIT_LIST_HEAD(&priv->pmklist.head); INIT_LIST_HEAD(&priv->pmklist.head);
for (i = 0; i < PMK_LIST_MAX; i++) for (i = 0; i < PMK_LIST_MAX; i++)
INIT_LIST_HEAD(&priv->pmklist.pmk[i].list); INIT_LIST_HEAD(&priv->pmklist.pmk[i].list);
...@@ -2179,7 +2179,7 @@ static int ks_wlan_get_firmware_version(struct net_device *dev, ...@@ -2179,7 +2179,7 @@ static int ks_wlan_get_firmware_version(struct net_device *dev,
{ {
struct ks_wlan_private *priv = struct ks_wlan_private *priv =
(struct ks_wlan_private *)netdev_priv(dev); (struct ks_wlan_private *)netdev_priv(dev);
strcpy(extra, &(priv->firmware_version[0])); strcpy(extra, priv->firmware_version);
dwrq->length = priv->version_size + 1; dwrq->length = priv->version_size + 1;
return 0; return 0;
} }
...@@ -2437,7 +2437,7 @@ static int ks_wlan_data_read(struct net_device *dev, ...@@ -2437,7 +2437,7 @@ static int ks_wlan_data_read(struct net_device *dev,
read_length = priv->dev_size[priv->dev_count]; read_length = priv->dev_size[priv->dev_count];
/* Copy data */ /* Copy data */
memcpy(extra, &(priv->dev_data[priv->dev_count][0]), read_length); memcpy(extra, &priv->dev_data[priv->dev_count][0], read_length);
spin_unlock(&priv->dev_read_lock); /* release spin lock */ spin_unlock(&priv->dev_read_lock); /* release spin lock */
...@@ -3261,7 +3261,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq, ...@@ -3261,7 +3261,7 @@ static int ks_wlan_netdev_ioctl(struct net_device *dev, struct ifreq *rq,
switch (cmd) { switch (cmd) {
case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */ case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */
rc = ks_wlan_set_stop_request(dev, NULL, &(wrq->u.mode), NULL); rc = ks_wlan_set_stop_request(dev, NULL, &wrq->u.mode, NULL);
break; break;
// All other calls are currently unsupported // All other calls are currently unsupported
default: default:
......
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