Commit f57c1edc authored by Yogesh Ashok Powar's avatar Yogesh Ashok Powar Committed by John W. Linville

mwifiex: fix checkpatch --strict warnings/errors Part 4

For files main.c, main.h and pcie.c
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 931f1584
...@@ -64,11 +64,10 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, ...@@ -64,11 +64,10 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
adapter->priv_num = 0; adapter->priv_num = 0;
/* Allocate memory for private structure */ /* Allocate memory for private structure */
adapter->priv[0] = kzalloc(sizeof(struct mwifiex_private), adapter->priv[0] = kzalloc(sizeof(struct mwifiex_private), GFP_KERNEL);
GFP_KERNEL);
if (!adapter->priv[0]) { if (!adapter->priv[0]) {
dev_err(adapter->dev, "%s: failed to alloc priv[0]\n", dev_err(adapter->dev,
__func__); "%s: failed to alloc priv[0]\n", __func__);
goto error; goto error;
} }
...@@ -169,8 +168,8 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -169,8 +168,8 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
if ((adapter->ps_state == PS_STATE_SLEEP) && if ((adapter->ps_state == PS_STATE_SLEEP) &&
(adapter->pm_wakeup_card_req && (adapter->pm_wakeup_card_req &&
!adapter->pm_wakeup_fw_try) && !adapter->pm_wakeup_fw_try) &&
(is_command_pending(adapter) (is_command_pending(adapter) ||
|| !mwifiex_wmm_lists_empty(adapter))) { !mwifiex_wmm_lists_empty(adapter))) {
adapter->pm_wakeup_fw_try = true; adapter->pm_wakeup_fw_try = true;
adapter->if_ops.wakeup(adapter); adapter->if_ops.wakeup(adapter);
continue; continue;
...@@ -187,10 +186,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -187,10 +186,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
adapter->tx_lock_flag) adapter->tx_lock_flag)
break; break;
if (adapter->scan_processing || adapter->data_sent if (adapter->scan_processing || adapter->data_sent ||
|| mwifiex_wmm_lists_empty(adapter)) { mwifiex_wmm_lists_empty(adapter)) {
if (adapter->cmd_sent || adapter->curr_cmd if (adapter->cmd_sent || adapter->curr_cmd ||
|| (!is_command_pending(adapter))) (!is_command_pending(adapter)))
break; break;
} }
} }
...@@ -223,10 +222,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -223,10 +222,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
/* * The ps_state may have been changed during processing of /* * The ps_state may have been changed during processing of
* Sleep Request event. * Sleep Request event.
*/ */
if ((adapter->ps_state == PS_STATE_SLEEP) if ((adapter->ps_state == PS_STATE_SLEEP) ||
|| (adapter->ps_state == PS_STATE_PRE_SLEEP) (adapter->ps_state == PS_STATE_PRE_SLEEP) ||
|| (adapter->ps_state == PS_STATE_SLEEP_CFM) (adapter->ps_state == PS_STATE_SLEEP_CFM) ||
|| adapter->tx_lock_flag) adapter->tx_lock_flag)
continue; continue;
if (!adapter->cmd_sent && !adapter->curr_cmd) { if (!adapter->cmd_sent && !adapter->curr_cmd) {
...@@ -249,8 +248,8 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) ...@@ -249,8 +248,8 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
} }
if (adapter->delay_null_pkt && !adapter->cmd_sent && if (adapter->delay_null_pkt && !adapter->cmd_sent &&
!adapter->curr_cmd && !is_command_pending(adapter) !adapter->curr_cmd && !is_command_pending(adapter) &&
&& mwifiex_wmm_lists_empty(adapter)) { mwifiex_wmm_lists_empty(adapter)) {
if (!mwifiex_send_null_packet if (!mwifiex_send_null_packet
(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA), (mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET | MWIFIEX_TxPD_POWER_MGMT_NULL_PACKET |
...@@ -371,7 +370,7 @@ mwifiex_fill_buffer(struct sk_buff *skb) ...@@ -371,7 +370,7 @@ mwifiex_fill_buffer(struct sk_buff *skb)
iph = ip_hdr(skb); iph = ip_hdr(skb);
tid = IPTOS_PREC(iph->tos); tid = IPTOS_PREC(iph->tos);
pr_debug("data: packet type ETH_P_IP: %04x, tid=%#x prio=%#x\n", pr_debug("data: packet type ETH_P_IP: %04x, tid=%#x prio=%#x\n",
eth->h_proto, tid, skb->priority); eth->h_proto, tid, skb->priority);
break; break;
case __constant_htons(ETH_P_ARP): case __constant_htons(ETH_P_ARP):
pr_debug("data: ARP packet: %04x\n", eth->h_proto); pr_debug("data: ARP packet: %04x\n", eth->h_proto);
...@@ -425,7 +424,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -425,7 +424,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct mwifiex_txinfo *tx_info; struct mwifiex_txinfo *tx_info;
dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n", dev_dbg(priv->adapter->dev, "data: %lu BSS(%d-%d): Data <= kernel\n",
jiffies, priv->bss_type, priv->bss_num); jiffies, priv->bss_type, priv->bss_num);
if (priv->adapter->surprise_removed) { if (priv->adapter->surprise_removed) {
kfree_skb(skb); kfree_skb(skb);
...@@ -441,7 +440,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -441,7 +440,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) { if (skb_headroom(skb) < MWIFIEX_MIN_DATA_HEADER_LEN) {
dev_dbg(priv->adapter->dev, dev_dbg(priv->adapter->dev,
"data: Tx: insufficient skb headroom %d\n", "data: Tx: insufficient skb headroom %d\n",
skb_headroom(skb)); skb_headroom(skb));
/* Insufficient skb headroom - allocate a new skb */ /* Insufficient skb headroom - allocate a new skb */
new_skb = new_skb =
skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN); skb_realloc_headroom(skb, MWIFIEX_MIN_DATA_HEADER_LEN);
...@@ -454,7 +453,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -454,7 +453,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
kfree_skb(skb); kfree_skb(skb);
skb = new_skb; skb = new_skb;
dev_dbg(priv->adapter->dev, "info: new skb headroomd %d\n", dev_dbg(priv->adapter->dev, "info: new skb headroomd %d\n",
skb_headroom(skb)); skb_headroom(skb));
} }
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
...@@ -494,8 +493,8 @@ mwifiex_set_mac_address(struct net_device *dev, void *addr) ...@@ -494,8 +493,8 @@ mwifiex_set_mac_address(struct net_device *dev, void *addr)
if (!ret) if (!ret)
memcpy(priv->netdev->dev_addr, priv->curr_addr, ETH_ALEN); memcpy(priv->netdev->dev_addr, priv->curr_addr, ETH_ALEN);
else else
dev_err(priv->adapter->dev, "set mac address failed: ret=%d" dev_err(priv->adapter->dev,
"\n", ret); "set mac address failed: ret=%d\n", ret);
memcpy(dev->dev_addr, priv->curr_addr, ETH_ALEN); memcpy(dev->dev_addr, priv->curr_addr, ETH_ALEN);
...@@ -533,7 +532,7 @@ mwifiex_tx_timeout(struct net_device *dev) ...@@ -533,7 +532,7 @@ mwifiex_tx_timeout(struct net_device *dev)
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
dev_err(priv->adapter->dev, "%lu : Tx timeout, bss_type-num = %d-%d\n", dev_err(priv->adapter->dev, "%lu : Tx timeout, bss_type-num = %d-%d\n",
jiffies, priv->bss_type, priv->bss_num); jiffies, priv->bss_type, priv->bss_num);
mwifiex_set_trans_start(dev); mwifiex_set_trans_start(dev);
priv->num_tx_timeout++; priv->num_tx_timeout++;
} }
...@@ -704,7 +703,7 @@ mwifiex_add_card(void *card, struct semaphore *sem, ...@@ -704,7 +703,7 @@ mwifiex_add_card(void *card, struct semaphore *sem,
rtnl_lock(); rtnl_lock();
/* Create station interface by default */ /* Create station interface by default */
if (!mwifiex_add_virtual_intf(priv->wdev->wiphy, "mlan%d", if (!mwifiex_add_virtual_intf(priv->wdev->wiphy, "mlan%d",
NL80211_IFTYPE_STATION, NULL, NULL)) { NL80211_IFTYPE_STATION, NULL, NULL)) {
rtnl_unlock(); rtnl_unlock();
dev_err(adapter->dev, "cannot create default station" dev_err(adapter->dev, "cannot create default station"
" interface\n"); " interface\n");
...@@ -781,7 +780,7 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) ...@@ -781,7 +780,7 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
if (priv && priv->netdev) { if (priv && priv->netdev) {
if (!netif_queue_stopped(priv->netdev)) if (!netif_queue_stopped(priv->netdev))
mwifiex_stop_net_dev_queue(priv->netdev, mwifiex_stop_net_dev_queue(priv->netdev,
adapter); adapter);
if (netif_carrier_ok(priv->netdev)) if (netif_carrier_ok(priv->netdev))
netif_carrier_off(priv->netdev); netif_carrier_off(priv->netdev);
} }
......
...@@ -841,8 +841,8 @@ mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter, ...@@ -841,8 +841,8 @@ mwifiex_get_priv_by_id(struct mwifiex_adapter *adapter,
for (i = 0; i < adapter->priv_num; i++) { for (i = 0; i < adapter->priv_num; i++) {
if (adapter->priv[i]) { if (adapter->priv[i]) {
if ((adapter->priv[i]->bss_num == bss_num) if ((adapter->priv[i]->bss_num == bss_num) &&
&& (adapter->priv[i]->bss_type == bss_type)) (adapter->priv[i]->bss_type == bss_type))
break; break;
} }
} }
......
This diff is collapsed.
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