* [PATCH 0/3] ath6kl: neatening
@ 2011-07-17 18:43 Joe Perches
2011-07-17 18:43 ` [PATCH 1/3] ath6kl: Add missing newlines and coalesce messages Joe Perches
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Joe Perches @ 2011-07-17 18:43 UTC (permalink / raw)
To: Kalle Valo
Cc: devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X, gregkh-l3A5Bk7waGM,
error27-Re5JQEeQqe8AvxtiuMwx3w,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
Joe Perches (3):
ath6kl: Add missing newlines and coalesce messages
ath6kl: Remove __func__ uses from ath6kl_err
ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper
drivers/net/wireless/ath/ath6kl/bmi.c | 2 +-
drivers/net/wireless/ath/ath6kl/cfg80211.c | 230 ++++++++-------------------
drivers/net/wireless/ath/ath6kl/debug.c | 2 +-
drivers/net/wireless/ath/ath6kl/htc.c | 15 +-
drivers/net/wireless/ath/ath6kl/htc_hif.c | 3 +-
drivers/net/wireless/ath/ath6kl/init.c | 79 ++++------
drivers/net/wireless/ath/ath6kl/main.c | 16 +-
drivers/net/wireless/ath/ath6kl/txrx.c | 53 +++----
drivers/net/wireless/ath/ath6kl/wmi.c | 29 ++--
9 files changed, 155 insertions(+), 274 deletions(-)
--
1.7.6.131.g99019
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/3] ath6kl: Add missing newlines and coalesce messages 2011-07-17 18:43 [PATCH 0/3] ath6kl: neatening Joe Perches @ 2011-07-17 18:43 ` Joe Perches 2011-07-17 18:43 ` [PATCH 2/3] ath6kl: Remove __func__ uses from ath6kl_err Joe Perches ` (2 subsequent siblings) 3 siblings, 0 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 18:43 UTC (permalink / raw) To: Kalle Valo, linux-kernel Cc: devel, gregkh, error27, John W. Linville, linux-wireless, netdev Logging messages should end in newlines. Multiple ath6kl_dbg uses should be coalesced where possible. Convert two otherwise identical format strings to the same case to save some space. Use __func__ in a couple of places as appropriate. Signed-off-by: Joe Perches <joe@perches.com> --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 13 +++++++------ drivers/net/wireless/ath/ath6kl/debug.c | 2 +- drivers/net/wireless/ath/ath6kl/htc.c | 18 ++++++++---------- drivers/net/wireless/ath/ath6kl/init.c | 5 ++--- drivers/net/wireless/ath/ath6kl/txrx.c | 16 ++++++++++------ drivers/net/wireless/ath/ath6kl/wmi.c | 21 +++++++++++---------- 6 files changed, 39 insertions(+), 36 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index ab75e0a..f556e23 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -360,8 +360,9 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: connect called with authmode %d dot11 auth %d" - " PW crypto %d PW crypto Len %d GRP crypto %d" - " GRP crypto Len %d channel hint %u\n", __func__, + " PW crypto %d PW crypto len %d GRP crypto %d" + " GRP crypto len %d channel hint %u\n", + __func__, ar->auth_mode, ar->dot11_auth_mode, ar->prwise_crypto, ar->prwise_crypto_len, ar->grp_crypto, ar->grp_crpto_len, ar->ch_hint); @@ -929,8 +930,7 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, del_timer(&ar->disconnect_timer); ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: index %d, key_len %d, key_type 0x%x," - " key_usage 0x%x, seq_len %d\n", + "%s: index %d, key_len %d, key_type 0x%x, key_usage 0x%x, seq_len %d\n", __func__, key_index, key->key_len, key_type, key_usage, key->seq_len); @@ -1348,7 +1348,8 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: connect called with authmode %d dot11 auth %d" " PW crypto %d PW crypto len %d GRP crypto %d" - " GRP crypto len %d channel hint %u\n", __func__, + " GRP crypto len %d channel hint %u\n", + __func__, ar->auth_mode, ar->dot11_auth_mode, ar->prwise_crypto, ar->prwise_crypto_len, ar->grp_crypto, ar->grp_crpto_len, ar->ch_hint); @@ -1534,7 +1535,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; } else { - ath6kl_warn("%s: invalid rate: %d", __func__, rate); + ath6kl_warn("%s: invalid rate: %d\n", __func__, rate); return 0; } diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index ea11e7b..316136c 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c @@ -97,7 +97,7 @@ void ath6kl_dump_registers(struct ath6kl_device *dev, ath6kl_dbg(ATH6KL_DBG_ANY, "Counter Int status Enable: 0x%x\n", irq_enable_reg->cntr_int_status_en); } - ath6kl_dbg(ATH6KL_DBG_ANY, "<------------------------------->"); + ath6kl_dbg(ATH6KL_DBG_ANY, "<------------------------------->\n"); } static void dump_cred_dist(struct htc_endpoint_credit_dist *ep_dist) diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index f4fa8d2..f9b2294 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.c +++ b/drivers/net/wireless/ath/ath6kl/htc.c @@ -81,8 +81,8 @@ static void htc_tx_comp_update(struct htc_target *target, if (!packet->status) return; - ath6kl_err("htc_tx_comp_update: req failed " - "(status:%d, ep:%d, len:%d creds:%d)\n", + ath6kl_err("%s: req failed (status:%d, ep:%d, len:%d creds:%d)\n", + __func__, packet->status, packet->endpoint, packet->act_len, packet->info.tx.cred_used); @@ -176,9 +176,8 @@ static int htc_issue_send(struct htc_target *target, struct htc_packet *packet) send_len = packet->act_len + HTC_HDR_LENGTH; - ath6kl_dbg(ATH6KL_DBG_HTC_SEND, - "htc_issue_send: transmit len : %d (%s)\n", - send_len, sync ? "sync" : "async"); + ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "%s: transmit len : %d (%s)\n", + __func__, send_len, sync ? "sync" : "async"); padded_len = CALC_TXRX_PADDED_LEN(target->dev, send_len); @@ -233,8 +232,8 @@ static int htc_check_credits(struct htc_target *target, if (ep->cred_dist.credits < *req_cred) { ath6kl_dbg(ATH6KL_DBG_HTC_SEND, - "not enough credits for ep %d leaving " - "packet in queue\n", eid); + "not enough credits for ep %d - leaving packet in queue\n", + eid); return -EINVAL; } } @@ -907,9 +906,8 @@ static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet, padded_len = CALC_TXRX_PADDED_LEN(dev, rx_len); if (padded_len > packet->buf_len) { - ath6kl_err("dev_rx_pkt, not enough space for padlen:%d " - "recvlen:%d bufferlen:%d\n", - padded_len, rx_len, packet->buf_len); + ath6kl_err("%s: not enough space for padlen:%d recvlen:%d bufferlen:%d\n", + __func__, padded_len, rx_len, packet->buf_len); return -ENOMEM; } diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 6094e43..dae5442 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -347,9 +347,8 @@ static int ath6kl_set_htc_params(struct ath6kl *ar, u32 mbox_isr_yield_val, (u8 *)&mbox_isr_yield_val, 4); if (status) { - ath6kl_err("%s: bmi_write_memory for yield " - "limit failed\n", - __func__); + ath6kl_err("%s: bmi_write_memory for yield limit failed\n", + __func__); goto out; } } diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index c9df26a..1125b37 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -541,10 +541,6 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue) if (!status && (packet->act_len != skb->len)) goto fatal; - ath6kl_dbg(ATH6KL_DBG_WLAN_TX, - "%s: skb=0x%p data=0x%p len=0x%x eid=%d ", - __func__, skb, packet->buf, packet->act_len, eid); - ar->tx_pending[eid]--; if (eid != ar->ctrl_ep) @@ -568,8 +564,16 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue) if (status != -ENOSPC) ath6kl_err("%s: tx error, status: 0x%x\n", __func__, status); + ath6kl_dbg(ATH6KL_DBG_WLAN_TX, + "%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n", + __func__, skb, packet->buf, packet->act_len, + eid, "error!"); } else { - ath6kl_dbg(ATH6KL_DBG_WLAN_TX, "OK\n"); + ath6kl_dbg(ATH6KL_DBG_WLAN_TX, + "%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n", + __func__, skb, packet->buf, packet->act_len, + eid, "OK"); + flushing = false; ar->net_stats.tx_packets++; ar->net_stats.tx_bytes += skb->len; @@ -640,7 +644,7 @@ static void ath6kl_alloc_netbufs(struct sk_buff_head *q, u16 num) while (num) { skb = ath6kl_buf_alloc(ATH6KL_BUFFER_SIZE); if (!skb) { - ath6kl_err("%s: netbuf allocation failed", __func__); + ath6kl_err("%s: netbuf allocation failed\n", __func__); return; } skb_queue_tail(q, skb); diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 38270bb..5d95b56 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -570,11 +570,11 @@ static int ath6kl_wmi_peer_node_event_rx(struct wmi *wmi, u8 *datap, int len) ev = (struct wmi_peer_node_event *) datap; if (ev->event_code == PEER_NODE_JOIN_EVENT) - ath6kl_dbg(ATH6KL_DBG_WMI, "joined node with mac addr: %pM", - ev->peer_mac_addr); + ath6kl_dbg(ATH6KL_DBG_WMI, "joined node with mac addr: %pM\n", + ev->peer_mac_addr); else if (ev->event_code == PEER_NODE_LEAVE_EVENT) - ath6kl_dbg(ATH6KL_DBG_WMI, "left node with mac addr: %pM", - ev->peer_mac_addr); + ath6kl_dbg(ATH6KL_DBG_WMI, "left node with mac addr: %pM\n", + ev->peer_mac_addr); return 0; } @@ -1027,24 +1027,25 @@ static int ath6kl_wmi_scan_complete_rx(struct wmi *wmi, u8 *datap, int len) */ static int ath6kl_wmi_error_event_rx(struct wmi *wmi, u8 *datap, int len) { + const char *type = "unknown error"; struct wmi_cmd_error_event *ev; - ev = (struct wmi_cmd_error_event *) datap; - ath6kl_dbg(ATH6KL_DBG_WMI, "programming error, cmd=%d ", ev->cmd_id); - switch (ev->err_code) { case INVALID_PARAM: - ath6kl_dbg(ATH6KL_DBG_WMI, "illegal parameter\n"); + type = "invalid parameter"; break; case ILLEGAL_STATE: - ath6kl_dbg(ATH6KL_DBG_WMI, "illegal state\n"); + type = "invalid state"; break; case INTERNAL_ERROR: - ath6kl_dbg(ATH6KL_DBG_WMI, "internal error\n"); + type = "internal error"; break; } + ath6kl_dbg(ATH6KL_DBG_WMI, "programming error, cmd=%d %s\n", + ev->cmd_id, type); + return 0; } -- 1.7.6.131.g99019 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] ath6kl: Remove __func__ uses from ath6kl_err 2011-07-17 18:43 [PATCH 0/3] ath6kl: neatening Joe Perches 2011-07-17 18:43 ` [PATCH 1/3] ath6kl: Add missing newlines and coalesce messages Joe Perches @ 2011-07-17 18:43 ` Joe Perches 2011-07-17 18:43 ` [PATCH 3/3] ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper Joe Perches 2011-07-17 18:56 ` [PATCH 0/3] ath6kl: neatening Kalle Valo 3 siblings, 0 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 18:43 UTC (permalink / raw) To: Kalle Valo, linux-kernel Cc: devel, gregkh, error27, John W. Linville, linux-wireless, netdev Remove unnecessary clutter from ath6kl_err messages. Signed-off-by: Joe Perches <joe@perches.com> --- drivers/net/wireless/ath/ath6kl/bmi.c | 2 +- drivers/net/wireless/ath/ath6kl/cfg80211.c | 129 +++++++++++++-------------- drivers/net/wireless/ath/ath6kl/htc.c | 7 +- drivers/net/wireless/ath/ath6kl/htc_hif.c | 3 +- drivers/net/wireless/ath/ath6kl/init.c | 78 +++++++---------- drivers/net/wireless/ath/ath6kl/main.c | 16 ++-- drivers/net/wireless/ath/ath6kl/txrx.c | 39 ++++----- drivers/net/wireless/ath/ath6kl/wmi.c | 8 +- 8 files changed, 125 insertions(+), 157 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c index 1aed4f1..8467669 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.c +++ b/drivers/net/wireless/ath/ath6kl/bmi.c @@ -55,7 +55,7 @@ static int ath6kl_get_bmi_cmd_credits(struct ath6kl *ar) } if (!ar->bmi.cmd_credits) { - ath6kl_err("%s bmi communication timeout\n", __func__); + ath6kl_err("bmi communication timeout\n"); return -ETIMEDOUT; } diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index f556e23..34df184 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -196,7 +196,7 @@ static int ath6kl_set_cipher(struct ath6kl *ar, u32 cipher, bool ucast) *ar_cipher_len = 0; break; default: - ath6kl_err("%s: cipher 0x%x not supported\n", __func__, cipher); + ath6kl_err("cipher 0x%x not supported\n", cipher); return -ENOTSUPP; } @@ -226,40 +226,39 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ar->sme_state = SME_CONNECTING; if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready yet\n", __func__); + ath6kl_err("wmi is not ready yet\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) { - ath6kl_err("%s: destroy in progress\n", __func__); + ath6kl_err("destroy in progress\n"); return -EBUSY; } if (!sme->ssid_len || sme->ssid_len > IEEE80211_MAX_SSID_LEN) { - ath6kl_err("%s: ssid invalid\n", __func__); + ath6kl_err("ssid invalid\n"); return -EINVAL; } if (test_bit(SKIP_SCAN, &ar->flag) && ((sme->channel && sme->channel->center_freq == 0) || (sme->bssid && is_zero_ether_addr(sme->bssid)))) { - ath6kl_err("%s: SkipScan: channel or bssid invalid\n", - __func__); + ath6kl_err("SkipScan: channel or bssid invalid\n"); return -EINVAL; } if (down_interruptible(&ar->sem)) { - ath6kl_err("%s: busy, couldn't get access\n", __func__); + ath6kl_err("busy, couldn't get access\n"); return -ERESTARTSYS; } if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) { - ath6kl_err("%s: busy, destroy in progress\n", __func__); + ath6kl_err("busy, destroy in progress\n"); up(&ar->sem); return -EBUSY; } @@ -272,7 +271,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ar->tx_pending[ath6kl_wmi_get_control_ep(ar->wmi)] == 0, WMI_TIMEOUT); if (signal_pending(current)) { - ath6kl_err("%s: cmd queue drain timeout\n", __func__); + ath6kl_err("cmd queue drain timeout\n"); up(&ar->sem); return -EINTR; } @@ -287,7 +286,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, up(&ar->sem); if (status) { - ath6kl_err("%s: wmi_reconnect_cmd failed\n", __func__); + ath6kl_err("wmi_reconnect_cmd failed\n"); return -EIO; } return 0; @@ -326,8 +325,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, if (sme->key_idx < WMI_MIN_KEY_INDEX || sme->key_idx > WMI_MAX_KEY_INDEX) { - ath6kl_err("%s: key index %d out of bounds\n", - __func__, sme->key_idx); + ath6kl_err("key index %d out of bounds\n", + sme->key_idx); up(&ar->sem); return -ENOENT; } @@ -349,8 +348,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, if (!ar->usr_bss_filter) { if (ath6kl_wmi_bssfilter_cmd(ar->wmi, ALL_BSS_FILTER, 0) != 0) { - ath6kl_err("%s: couldn't set bss filtering\n", - __func__); + ath6kl_err("couldn't set bss filtering\n"); up(&ar->sem); return -EIO; } @@ -382,10 +380,10 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, if (status == -EINVAL) { memset(ar->ssid, 0, sizeof(ar->ssid)); ar->ssid_len = 0; - ath6kl_err("%s: invalid request\n", __func__); + ath6kl_err("invalid request\n"); return -ENOENT; } else if (status) { - ath6kl_err("%s: ath6kl_wmi_connect_cmd failed\n", __func__); + ath6kl_err("ath6kl_wmi_connect_cmd failed\n"); return -EIO; } @@ -521,7 +519,7 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel, ieeemgmtbuf = kzalloc(size, GFP_ATOMIC); if (!ieeemgmtbuf) { - ath6kl_err("%s: ieee mgmt buf alloc error\n", __func__); + ath6kl_err("ieee mgmt buf alloc error\n"); cfg80211_put_bss(bss); return; } @@ -578,22 +576,22 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy, reason_code); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) { - ath6kl_err("%s: busy, destroy in progress\n", __func__); + ath6kl_err("busy, destroy in progress\n"); return -EBUSY; } if (down_interruptible(&ar->sem)) { - ath6kl_err("%s: busy, couldn't get access\n", __func__); + ath6kl_err("busy, couldn't get access\n"); return -ERESTARTSYS; } @@ -685,7 +683,7 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason, */ key = &ar->keys[ar->def_txkey_index]; if (down_interruptible(&ar->sem)) { - ath6kl_err("%s: busy, couldn't get access\n", __func__); + ath6kl_err("busy, couldn't get access\n"); return; } @@ -746,7 +744,7 @@ static void ath6kl_cfg80211_scan_node(void *arg, struct bss *ni) size = ni->ni_framelen + offsetof(struct ieee80211_mgmt, u); ieeemgmtbuf = kmalloc(size, GFP_ATOMIC); if (!ieeemgmtbuf) { - ath6kl_err("%s: ieee mgmt buf alloc error\n", __func__); + ath6kl_err("ieee mgmt buf alloc error\n"); return; } @@ -784,12 +782,12 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, u32 force_fg_scan = 0; if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -798,8 +796,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, (test_bit(CONNECTED, &ar->flag) ? ALL_BUT_BSS_FILTER : ALL_BSS_FILTER), 0) != 0) { - ath6kl_err("%s: couldn't set bss filtering\n", - __func__); + ath6kl_err("couldn't set bss filtering\n"); return -EIO; } } @@ -822,7 +819,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, if (ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, force_fg_scan, false, 0, 0, 0, NULL) != 0) { - ath6kl_err("%s: wmi_startscan_cmd failed\n", __func__); + ath6kl_err("wmi_startscan_cmd failed\n"); ret = -EIO; } @@ -870,12 +867,12 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, int status = 0; if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -955,12 +952,12 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -995,12 +992,12 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1037,12 +1034,12 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1085,12 +1082,12 @@ static int ath6kl_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1119,20 +1116,19 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) changed); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } if (changed & WIPHY_PARAM_RTS_THRESHOLD) { ret = ath6kl_wmi_set_rts_cmd(ar->wmi, wiphy->rts_threshold); if (ret != 0) { - ath6kl_err("%s: ath6kl_wmi_set_rts_cmd failed\n", - __func__); + ath6kl_err("ath6kl_wmi_set_rts_cmd failed\n"); return -EIO; } } @@ -1155,12 +1151,12 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy, type, dbm); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1186,12 +1182,12 @@ static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1199,8 +1195,7 @@ static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) ar->tx_pwr = 0; if (ath6kl_wmi_get_tx_pwr_cmd(ar->wmi) != 0) { - ath6kl_err("%s: ath6kl_wmi_get_tx_pwr_cmd failed\n", - __func__); + ath6kl_err("ath6kl_wmi_get_tx_pwr_cmd failed\n"); return -EIO; } @@ -1208,7 +1203,7 @@ static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) 5 * HZ); if (signal_pending(current)) { - ath6kl_err("%s: target did not respond\n", __func__); + ath6kl_err("target did not respond\n"); return -EINTR; } } @@ -1228,12 +1223,12 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, __func__, pmgmt, timeout); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1246,7 +1241,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, } if (ath6kl_wmi_powermode_cmd(ar->wmi, mode.pwr_mode) != 0) { - ath6kl_err("%s: wmi_powermode_cmd failed\n", __func__); + ath6kl_err("wmi_powermode_cmd failed\n"); return -EIO; } @@ -1264,12 +1259,12 @@ static int ath6kl_cfg80211_change_iface(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type %u\n", __func__, type); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1281,7 +1276,7 @@ static int ath6kl_cfg80211_change_iface(struct wiphy *wiphy, ar->next_mode = ADHOC_NETWORK; break; default: - ath6kl_err("%s: invalid type %u\n", __func__, type); + ath6kl_err("invalid interface type %u\n", type); return -EOPNOTSUPP; } @@ -1298,18 +1293,18 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, int status; if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } - if (!ibss_param->ssid_len - || IEEE80211_MAX_SSID_LEN < ibss_param->ssid_len) { - ath6kl_err("%s: ssid invalid\n", __func__); + if (!ibss_param->ssid_len || + IEEE80211_MAX_SSID_LEN < ibss_param->ssid_len) { + ath6kl_err("ssid invalid\n"); return -EINVAL; } @@ -1373,12 +1368,12 @@ static int ath6kl_cfg80211_leave_ibss(struct wiphy *wiphy, struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(dev); if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("%s: wmi is not ready\n", __func__); + ath6kl_err("wmi is not ready\n"); return -EIO; } if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("%s: wlan disabled\n", __func__); + ath6kl_err("wlan disabled\n"); return -EIO; } @@ -1535,7 +1530,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev, sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH; sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS; } else { - ath6kl_warn("%s: invalid rate: %d\n", __func__, rate); + ath6kl_warn("invalid rate: %d\n", rate); return 0; } @@ -1597,14 +1592,14 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); if (!wdev) { - ath6kl_err("%s: couldn't allocate wireless device\n", __func__); + ath6kl_err("couldn't allocate wireless device\n"); return NULL; } /* create a new wiphy for use with cfg80211 */ wdev->wiphy = wiphy_new(&ath6kl_cfg80211_ops, sizeof(struct ath6kl)); if (!wdev->wiphy) { - ath6kl_err("%s: couldn't allocate wiphy device\n", __func__); + ath6kl_err("couldn't allocate wiphy device\n"); kfree(wdev); return NULL; } @@ -1625,7 +1620,7 @@ struct wireless_dev *ath6kl_cfg80211_init(struct device *dev) ret = wiphy_register(wdev->wiphy); if (ret < 0) { - ath6kl_err("%s: couldn't register wiphy device\n", __func__); + ath6kl_err("couldn't register wiphy device\n"); wiphy_free(wdev->wiphy); kfree(wdev); return NULL; diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index f9b2294..95c47bb 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.c +++ b/drivers/net/wireless/ath/ath6kl/htc.c @@ -81,8 +81,7 @@ static void htc_tx_comp_update(struct htc_target *target, if (!packet->status) return; - ath6kl_err("%s: req failed (status:%d, ep:%d, len:%d creds:%d)\n", - __func__, + ath6kl_err("req failed (status:%d, ep:%d, len:%d creds:%d)\n", packet->status, packet->endpoint, packet->act_len, packet->info.tx.cred_used); @@ -906,8 +905,8 @@ static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet, padded_len = CALC_TXRX_PADDED_LEN(dev, rx_len); if (padded_len > packet->buf_len) { - ath6kl_err("%s: not enough space for padlen:%d recvlen:%d bufferlen:%d\n", - __func__, padded_len, rx_len, packet->buf_len); + ath6kl_err("not enough receive space for packet - padlen:%d recvlen:%d bufferlen:%d\n", + padded_len, rx_len, packet->buf_len); return -ENOMEM; } diff --git a/drivers/net/wireless/ath/ath6kl/htc_hif.c b/drivers/net/wireless/ath/ath6kl/htc_hif.c index bc06b3d..1bcaaec 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_hif.c +++ b/drivers/net/wireless/ath/ath6kl/htc_hif.c @@ -553,8 +553,7 @@ static int proc_pending_irqs(struct ath6kl_device *dev, bool *done) rg = &dev->irq_proc_reg; lk_ahd = le32_to_cpu(rg->rx_lkahd[HTC_MAILBOX]); if (!lk_ahd) - ath6kl_err("%s():lookAhead is zero!\n", - __func__); + ath6kl_err("lookAhead is zero!\n"); } } } diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index dae5442..fe61871 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -162,8 +162,8 @@ static int ath6kl_connectservice(struct ath6kl *ar, status = htc_conn_service(ar->htc_target, con_req, &response); if (status) { - ath6kl_err("%s: failed to connect to %s service status:%d\n", - __func__, desc, status); + ath6kl_err("failed to connect to %s service status:%d\n", + desc, status); return status; } @@ -186,8 +186,7 @@ static int ath6kl_connectservice(struct ath6kl *ar, set_ac2_ep_map(ar, WMM_AC_VO, response.endpoint); break; default: - ath6kl_err("%s: service id is not mapped %d\n", - __func__, con_req->svc_id); + ath6kl_err("service id is not mapped %d\n", con_req->svc_id); return -EINVAL; } @@ -330,8 +329,7 @@ static int ath6kl_set_htc_params(struct ath6kl *ar, u32 mbox_isr_yield_val, (u8 *)&blk_size, 4); if (status) { - ath6kl_err("%s: bmi_write_memory for IO block size failed\n", - __func__); + ath6kl_err("bmi_write_memory for IO block size failed\n"); goto out; } @@ -347,8 +345,7 @@ static int ath6kl_set_htc_params(struct ath6kl *ar, u32 mbox_isr_yield_val, (u8 *)&mbox_isr_yield_val, 4); if (status) { - ath6kl_err("%s: bmi_write_memory for yield limit failed\n", - __func__); + ath6kl_err("bmi_write_memory for yield limit failed\n"); goto out; } } @@ -379,8 +376,7 @@ static void ath6kl_dump_target_assert_info(struct ath6kl *ar) status = ath6kl_read_reg_diag(ar, &address, ®dump_loc); if (status || !regdump_loc) { - ath6kl_err("%s: failed to get ptr to register dump area\n", - __func__); + ath6kl_err("failed to get ptr to register dump area\n"); return; } @@ -410,7 +406,7 @@ static void ath6kl_dump_target_assert_info(struct ath6kl *ar) void ath6kl_target_failure(struct ath6kl *ar) { - ath6kl_err("%s: target asserted\n", __func__); + ath6kl_err("target asserted\n"); /* try dumping target assertion information (if any) */ ath6kl_dump_target_assert_info(ar); @@ -428,44 +424,39 @@ static int ath6kl_target_config_wlan_params(struct ath6kl *ar) */ if (ath6kl_wmi_set_rx_frame_format_cmd(ar->wmi, ar->rx_meta_ver, 0, 0)) { - ath6kl_err("%s: unable to set the rx frame format\n", __func__); + ath6kl_err("unable to set the rx frame format\n"); status = -EIO; } if (ar->conf_flags & ATH6KL_CONF_IGNORE_PS_FAIL_EVT_IN_SCAN) if ((ath6kl_wmi_pmparams_cmd(ar->wmi, 0, 1, 0, 0, 1, IGNORE_POWER_SAVE_FAIL_EVENT_DURING_SCAN)) != 0) { - ath6kl_err("%s: unable to set power save fail event policy\n", - __func__); + ath6kl_err("unable to set power save fail event policy\n"); status = -EIO; } if (!(ar->conf_flags & ATH6KL_CONF_IGNORE_ERP_BARKER)) if ((ath6kl_wmi_set_lpreamble_cmd(ar->wmi, 0, WMI_DONOT_IGNORE_BARKER_IN_ERP)) != 0) { - ath6kl_err("%s: unable to set barker preamble policy\n", - __func__); + ath6kl_err("unable to set barker preamble policy\n"); status = -EIO; } if (ath6kl_wmi_set_keepalive_cmd(ar->wmi, WLAN_CONFIG_KEEP_ALIVE_INTERVAL)) { - ath6kl_err("%s: unable to set keep alive interval\n", - __func__); + ath6kl_err("unable to set keep alive interval\n"); status = -EIO; } if (ath6kl_wmi_disctimeout_cmd(ar->wmi, WLAN_CONFIG_DISCONNECT_TIMEOUT)) { - ath6kl_err("%s: unable to set disconnect timeout\n", - __func__); + ath6kl_err("unable to set disconnect timeout\n"); status = -EIO; } if (!(ar->conf_flags & ATH6KL_CONF_ENABLE_TX_BURST)) if (ath6kl_wmi_set_wmm_txop(ar->wmi, WMI_TXOP_DISABLED)) { - ath6kl_err("%s: unable to set txop bursting\n", - __func__); + ath6kl_err("unable to set txop bursting\n"); status = -EIO; } @@ -487,8 +478,7 @@ int ath6kl_configure_target(struct ath6kl *ar) ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_app_host_interest)), (u8 *)¶m, 4) != 0) { - ath6kl_err("%s: bmi_write_memory for htc version failed\n", - __func__); + ath6kl_err("bmi_write_memory for htc version failed\n"); return -EIO; } @@ -499,8 +489,7 @@ int ath6kl_configure_target(struct ath6kl *ar) ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_option_flag)), (u8 *)¶m, 4) != 0) { - ath6kl_err("%s: bmi_read_memory for setting fwmode failed\n", - __func__); + ath6kl_err("bmi_read_memory for setting fwmode failed\n"); return -EIO; } @@ -514,8 +503,7 @@ int ath6kl_configure_target(struct ath6kl *ar) HI_ITEM(hi_option_flag)), (u8 *)¶m, 4) != 0) { - ath6kl_err("%s: bmi_write_memory for setting fwmode failed\n", - __func__); + ath6kl_err("bmi_write_memory for setting fwmode failed\n"); return -EIO; } @@ -543,16 +531,14 @@ int ath6kl_configure_target(struct ath6kl *ar) ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_board_ext_data)), (u8 *)¶m, 4) != 0) { - ath6kl_err("%s: bmi_write_memory for hi_board_ext_data failed\n", - __func__); + ath6kl_err("bmi_write_memory for hi_board_ext_data failed\n"); return -EIO; } if (ath6kl_bmi_write(ar, ath6kl_get_hi_item_addr(ar, HI_ITEM(hi_end_ram_reserve_sz)), (u8 *)&ram_reserved_size, 4) != 0) { - ath6kl_err("%s: bmi_write_memory for hi_end_ram_reserve_sz failed\n", - __func__); + ath6kl_err("bmi_write_memory for hi_end_ram_reserve_sz failed\n"); return -EIO; } } @@ -573,7 +559,7 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev) wdev = ath6kl_cfg80211_init(sdev); if (!wdev) { - ath6kl_err("%s: ath6kl_cfg80211_init failed\n", __func__); + ath6kl_err("ath6kl_cfg80211_init failed\n"); return NULL; } @@ -584,8 +570,7 @@ struct ath6kl *ath6kl_core_alloc(struct device *sdev) dev = alloc_netdev(0, "wlan%d", ether_setup); if (!dev) { - ath6kl_err("%s: no memory for network device instance\n", - __func__); + ath6kl_err("no memory for network device instance\n"); ath6kl_cfg80211_deinit(ar); return NULL; } @@ -985,8 +970,7 @@ static int ath6kl_init_upload(struct ath6kl *ar) /* WAR to avoid SDIO CRC err */ if (ar->version.target_ver == AR6003_REV2_VERSION) { - ath6kl_err("%s: temporary war to avoid sdio crc error\n", - __func__); + ath6kl_err("temporary war to avoid sdio crc error\n"); param = 0x20; @@ -1071,7 +1055,7 @@ static int ath6kl_init(struct net_device *dev) set_bit(WMI_ENABLED, &ar->flag); ar->wmi = ath6kl_wmi_init((void *) ar); if (!ar->wmi) { - ath6kl_err("%s: failed to initialize wmi\n", __func__); + ath6kl_err("failed to initialize wmi\n"); status = -EIO; goto ath6kl_init_done; } @@ -1126,16 +1110,14 @@ static int ath6kl_init(struct net_device *dev) WMI_TIMEOUT); if (ar->version.abi_ver != ATH6KL_ABI_VERSION) { - ath6kl_err("%s: abi version mismatch: host(0x%x), target(0x%x)\n", - __func__, ATH6KL_ABI_VERSION, - ar->version.abi_ver); + ath6kl_err("abi version mismatch: host(0x%x), target(0x%x)\n", + ATH6KL_ABI_VERSION, ar->version.abi_ver); status = -EIO; goto err_htc_stop; } if (!timeleft || signal_pending(current)) { - ath6kl_err("%s: wmi is not ready or wait was interrupted\n", - __func__); + ath6kl_err("wmi is not ready or wait was interrupted\n"); status = -EIO; goto err_htc_stop; } @@ -1144,7 +1126,7 @@ static int ath6kl_init(struct net_device *dev) /* communicate the wmi protocol verision to the target */ if ((ath6kl_set_host_app_area(ar)) != 0) - ath6kl_err("%s: unable to set the host app area\n", __func__); + ath6kl_err("unable to set the host app area\n"); ar->conf_flags = ATH6KL_CONF_IGNORE_ERP_BARKER | ATH6KL_CONF_ENABLE_11N | ATH6KL_CONF_ENABLE_TX_BURST; @@ -1203,7 +1185,7 @@ int ath6kl_core_init(struct ath6kl *ar) ar->aggr_cntxt = aggr_init(ar->net_dev); if (!ar->aggr_cntxt) { - ath6kl_err("%s: failed to initialize aggr.\n", __func__); + ath6kl_err("failed to initialize aggr\n"); ret = -ENOMEM; goto err_htc_cleanup; } @@ -1219,7 +1201,7 @@ int ath6kl_core_init(struct ath6kl *ar) /* This runs the init function if registered */ ret = register_netdev(ar->net_dev); if (ret) { - ath6kl_err("%s: register_netdev failed\n", __func__); + ath6kl_err("register_netdev failed\n"); ath6kl_destroy(ar->net_dev, 0); return ret; } @@ -1250,7 +1232,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar) set_bit(DESTROY_IN_PROGRESS, &ar->flag); if (down_interruptible(&ar->sem)) { - ath6kl_err("%s: down_interruptible failed\n", __func__); + ath6kl_err("down_interruptible failed\n"); return; } @@ -1281,7 +1263,7 @@ void ath6kl_destroy(struct net_device *dev, unsigned int unregister) struct ath6kl *ar; if (!dev || !ath6kl_priv(dev)) { - ath6kl_err("%s: failed to get device structure\n", __func__); + ath6kl_err("failed to get device structure\n"); return; } diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index ec07888..f325a23 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -204,8 +204,8 @@ static int ath6kl_set_addrwin_reg(struct ath6kl *ar, u32 reg_addr, u32 addr) } if (status) { - ath6kl_err("%s: failed to write initial bytes of 0x%x to window reg: 0x%X\n", - __func__, addr, reg_addr); + ath6kl_err("failed to write initial bytes of 0x%x to window reg: 0x%X\n", + addr, reg_addr); return status; } @@ -219,8 +219,8 @@ static int ath6kl_set_addrwin_reg(struct ath6kl *ar, u32 reg_addr, u32 addr) 4, HIF_WR_SYNC_BYTE_INC); if (status) { - ath6kl_err("%s: failed to write 0x%x to window reg: 0x%X\n", - __func__, addr, reg_addr); + ath6kl_err("failed to write 0x%x to window reg: 0x%X\n", + addr, reg_addr); return status; } @@ -246,8 +246,7 @@ int ath6kl_read_reg_diag(struct ath6kl *ar, u32 *address, u32 *data) status = hif_read_write_sync(ar, WINDOW_DATA_ADDRESS, (u8 *)data, sizeof(u32), HIF_RD_SYNC_BYTE_INC); if (status) { - ath6kl_err("%s: failed to read from window data addr\n", - __func__); + ath6kl_err("failed to read from window data addr\n"); return status; } @@ -267,8 +266,7 @@ static int ath6kl_write_reg_diag(struct ath6kl *ar, u32 *address, u32 *data) status = hif_read_write_sync(ar, WINDOW_DATA_ADDRESS, (u8 *)data, sizeof(u32), HIF_WR_SYNC_BYTE_INC); if (status) { - ath6kl_err("%s: failed to write 0x%x to window data addr\n", - __func__, *data); + ath6kl_err("failed to write 0x%x to window data addr\n", *data); return status; } @@ -316,7 +314,7 @@ static void ath6kl_reset_device(struct ath6kl *ar, u32 target_type, status = ath6kl_write_reg_diag(ar, &address, &data); if (status) - ath6kl_err("%s: failed to reset target\n", __func__); + ath6kl_err("failed to reset target\n"); } void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile, diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index 1125b37..615b46d 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -194,8 +194,8 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb, * are just going to drop this packet. */ cookie = NULL; - ath6kl_err("%s: wmi ctrl ep full, dropping pkt : 0x%p, len:%d\n", - __func__, skb, skb->len); + ath6kl_err("wmi ctrl ep full, dropping pkt : 0x%p, len:%d\n", + skb, skb->len); } else cookie = ath6kl_alloc_cookie(ar); @@ -270,14 +270,13 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev) } if (ath6kl_wmi_dix_2_dot3(ar->wmi, skb)) { - ath6kl_err("%s: ath6kl_wmi_dix_2_dot3 failed\n", - __func__); + ath6kl_err("ath6kl_wmi_dix_2_dot3 failed\n"); goto fail_tx; } if (ath6kl_wmi_data_hdr_add(ar->wmi, skb, DATA_MSGTYPE, more_data, 0, 0, NULL)) { - ath6kl_err("%s: wmi_data_hdr_add failed\n", __func__); + ath6kl_err("wmi_data_hdr_add failed\n"); goto fail_tx; } @@ -302,7 +301,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev) eid = ar->ac2ep_map[ac]; if (eid == 0 || eid == ENDPOINT_UNUSED) { - ath6kl_err("%s: eid %d is not mapped!\n", __func__, eid); + ath6kl_err("eid %d is not mapped!\n", eid); spin_unlock_bh(&ar->lock); goto fail_tx; } @@ -423,7 +422,7 @@ enum htc_send_full_action ath6kl_tx_queue_full(struct htc_target *target, spin_lock_bh(&ar->lock); set_bit(WMI_CTRL_EP_FULL, &ar->flag); spin_unlock_bh(&ar->lock); - ath6kl_err("%s: wmi ctrl ep is full\n", __func__); + ath6kl_err("wmi ctrl ep is full\n"); return HTC_SEND_FULL_KEEP; } @@ -562,8 +561,7 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue) ar->net_stats.tx_errors++; if (status != -ENOSPC) - ath6kl_err("%s: tx error, status: 0x%x\n", - __func__, status); + ath6kl_err("tx error, status: 0x%x\n", status); ath6kl_dbg(ATH6KL_DBG_WLAN_TX, "%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n", __func__, skb, packet->buf, packet->act_len, @@ -644,7 +642,7 @@ static void ath6kl_alloc_netbufs(struct sk_buff_head *q, u16 num) while (num) { skb = ath6kl_buf_alloc(ATH6KL_BUFFER_SIZE); if (!skb) { - ath6kl_err("%s: netbuf allocation failed\n", __func__); + ath6kl_err("netbuf allocation failed\n"); return; } skb_queue_tail(q, skb); @@ -785,22 +783,22 @@ static void aggr_slice_amsdu(struct aggr_info *p_aggr, if (payload_8023_len < MIN_MSDU_SUBFRAME_PAYLOAD_LEN || payload_8023_len > MAX_MSDU_SUBFRAME_PAYLOAD_LEN) { - ath6kl_err("%s: 802.3 AMSDU frame bound check failed. len %d\n", - __func__, payload_8023_len); + ath6kl_err("802.3 AMSDU frame bound check failed. len %d\n", + payload_8023_len); break; } frame_8023_len = payload_8023_len + mac_hdr_len; new_skb = aggr_get_free_skb(p_aggr); if (!new_skb) { - ath6kl_err("%s: no buffer available\n", __func__); + ath6kl_err("no buffer available\n"); break; } memcpy(new_skb->data, framep, frame_8023_len); skb_put(new_skb, frame_8023_len); if (ath6kl_wmi_dot3_2_dix(new_skb)) { - ath6kl_err("%s: dot3_2_dix error\n", __func__); + ath6kl_err("dot3_2_dix error\n"); dev_kfree_skb(new_skb); break; } @@ -1080,10 +1078,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet) */ if (ar->nw_type != AP_NETWORK && ((packet->act_len < min_hdr_len) || - (packet->act_len > - WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH))) { - ath6kl_info("%s: frame len is too short or too long\n", - __func__); + (packet->act_len > WMI_MAX_AMSDU_RX_DATA_FRAME_LENGTH))) { + ath6kl_info("frame len is too short or too long\n"); ar->net_stats.rx_errors++; ar->net_stats.rx_length_errors++; dev_kfree_skb(skb); @@ -1255,8 +1251,8 @@ static void aggr_timeout(unsigned long arg) continue; stats->num_timeouts++; - ath6kl_err("%s: aggr timeout (st %d end %d)\n", - __func__, rxtid->seq_next, + ath6kl_err("aggr timeout (st %d end %d)\n", + rxtid->seq_next, ((rxtid->seq_next + rxtid->hold_q_sz-1) & ATH6KL_MAX_SEQ_NO)); aggr_deque_frms(p_aggr, i, 0, 0); @@ -1356,8 +1352,7 @@ struct aggr_info *aggr_init(struct net_device *dev) p_aggr = kzalloc(sizeof(struct aggr_info), GFP_KERNEL); if (!p_aggr) { - ath6kl_err("%s: failed to alloc memory for aggr_node\n", - __func__); + ath6kl_err("failed to alloc memory for aggr_node\n"); return NULL; } diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 5d95b56..a52d7d2 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -1373,7 +1373,7 @@ static int ath6kl_wmi_snr_threshold_event_rx(struct wmi *wmi, u8 *datap, ret = ath6kl_wmi_send_snr_threshold_params(wmi, &cmd); if (ret) { - ath6kl_err("%s: unable to configure snr threshold\n", __func__); + ath6kl_err("unable to configure snr threshold\n"); return -EIO; } @@ -2490,7 +2490,7 @@ static int ath6kl_wmi_control_rx_xtnd(struct wmi *wmi, struct sk_buff *skb) int ret = 0; if (skb->len < sizeof(struct wmix_cmd_hdr)) { - ath6kl_err("%s: bad packet 1\n", __func__); + ath6kl_err("bad packet 1\n"); wmi->stat.cmd_len_err++; return -EINVAL; } @@ -2509,7 +2509,7 @@ static int ath6kl_wmi_control_rx_xtnd(struct wmi *wmi, struct sk_buff *skb) case WMIX_DBGLOG_EVENTID: break; default: - ath6kl_err("%s: unknown cmd id 0x%x\n", __func__, id); + ath6kl_err("unknown cmd id 0x%x\n", id); wmi->stat.cmd_id_err++; ret = -EINVAL; break; @@ -2531,7 +2531,7 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) return -EINVAL; if (skb->len < sizeof(struct wmi_cmd_hdr)) { - ath6kl_err("%s: bad packet 1\n", __func__); + ath6kl_err("bad packet 1\n"); dev_kfree_skb(skb); wmi->stat.cmd_len_err++; return -EINVAL; -- 1.7.6.131.g99019 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper 2011-07-17 18:43 [PATCH 0/3] ath6kl: neatening Joe Perches 2011-07-17 18:43 ` [PATCH 1/3] ath6kl: Add missing newlines and coalesce messages Joe Perches 2011-07-17 18:43 ` [PATCH 2/3] ath6kl: Remove __func__ uses from ath6kl_err Joe Perches @ 2011-07-17 18:43 ` Joe Perches 2011-07-17 18:56 ` [PATCH 0/3] ath6kl: neatening Kalle Valo 3 siblings, 0 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 18:43 UTC (permalink / raw) To: Kalle Valo, linux-kernel Cc: devel, gregkh, error27, John W. Linville, linux-wireless, netdev Reduce code duplication by using a helper function to check if the device is ready. Signed-off-by: Joe Perches <joe@perches.com> --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 150 ++++++---------------------- 1 files changed, 30 insertions(+), 120 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 34df184..71515bb 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -217,6 +217,21 @@ static void ath6kl_set_key_mgmt(struct ath6kl *ar, u32 key_mgmt) } } +static bool ath6kl_cfg80211_ready(struct ath6kl *ar) +{ + if (!test_bit(WMI_READY, &ar->flag)) { + ath6kl_err("wmi is not ready\n"); + return false; + } + + if (ar->wlan_state == WLAN_DISABLED) { + ath6kl_err("wlan disabled\n"); + return false; + } + + return true; +} + static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_connect_params *sme) { @@ -225,15 +240,8 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ar->sme_state = SME_CONNECTING; - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready yet\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); - return -EIO; - } if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) { ath6kl_err("destroy in progress\n"); @@ -575,15 +583,8 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: reason=%u\n", __func__, reason_code); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) { ath6kl_err("busy, destroy in progress\n"); @@ -781,15 +782,8 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, int ret = 0; u32 force_fg_scan = 0; - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); - return -EIO; - } if (!ar->usr_bss_filter) { if (ath6kl_wmi_bssfilter_cmd(ar->wmi, @@ -866,15 +860,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, u8 key_type; int status = 0; - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, @@ -951,15 +938,8 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, @@ -991,15 +971,8 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, @@ -1033,15 +1006,8 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, @@ -1081,15 +1047,8 @@ static int ath6kl_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); - return -EIO; - } ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: not supported\n", __func__); return -ENOTSUPP; @@ -1115,15 +1074,8 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: changed 0x%x\n", __func__, changed); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (changed & WIPHY_PARAM_RTS_THRESHOLD) { ret = ath6kl_wmi_set_rts_cmd(ar->wmi, wiphy->rts_threshold); @@ -1150,15 +1102,8 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x, dbm %d\n", __func__, type, dbm); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } switch (type) { case NL80211_TX_POWER_AUTOMATIC: @@ -1181,15 +1126,8 @@ static int ath6kl_cfg80211_get_txpower(struct wiphy *wiphy, int *dbm) { struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (test_bit(CONNECTED, &ar->flag)) { ar->tx_pwr = 0; @@ -1222,15 +1160,8 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: pmgmt %d, timeout %d\n", __func__, pmgmt, timeout); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (pmgmt) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: max perf\n", __func__); @@ -1258,15 +1189,8 @@ static int ath6kl_cfg80211_change_iface(struct wiphy *wiphy, ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type %u\n", __func__, type); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } switch (type) { case NL80211_IFTYPE_STATION: @@ -1292,15 +1216,8 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, struct ath6kl *ar = ath6kl_priv(dev); int status; - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } if (!ibss_param->ssid_len || IEEE80211_MAX_SSID_LEN < ibss_param->ssid_len) { @@ -1367,15 +1284,8 @@ static int ath6kl_cfg80211_leave_ibss(struct wiphy *wiphy, { struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(dev); - if (!test_bit(WMI_READY, &ar->flag)) { - ath6kl_err("wmi is not ready\n"); - return -EIO; - } - - if (ar->wlan_state == WLAN_DISABLED) { - ath6kl_err("wlan disabled\n"); + if (!ath6kl_cfg80211_ready(ar)) return -EIO; - } ath6kl_disconnect(ar); memset(ar->ssid, 0, sizeof(ar->ssid)); -- 1.7.6.131.g99019 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] ath6kl: neatening 2011-07-17 18:43 [PATCH 0/3] ath6kl: neatening Joe Perches ` (2 preceding siblings ...) 2011-07-17 18:43 ` [PATCH 3/3] ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper Joe Perches @ 2011-07-17 18:56 ` Kalle Valo 2011-07-17 19:52 ` Joe Perches 3 siblings, 1 reply; 11+ messages in thread From: Kalle Valo @ 2011-07-17 18:56 UTC (permalink / raw) To: Joe Perches; +Cc: devel, gregkh, error27, linux-kernel, linux-wireless, netdev On 07/17/2011 09:43 PM, Joe Perches wrote: > Joe Perches (3): > ath6kl: Add missing newlines and coalesce messages > ath6kl: Remove __func__ uses from ath6kl_err > ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper Nice, thanks a lot. I'm planning to send v3 of athk6kl patches later today. Is it okay for you if I amend your three patches to that patchset? Kalle ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] ath6kl: neatening 2011-07-17 18:56 ` [PATCH 0/3] ath6kl: neatening Kalle Valo @ 2011-07-17 19:52 ` Joe Perches 2011-07-17 20:45 ` Kalle Valo 0 siblings, 1 reply; 11+ messages in thread From: Joe Perches @ 2011-07-17 19:52 UTC (permalink / raw) To: Kalle Valo; +Cc: devel, gregkh, error27, linux-kernel, linux-wireless, netdev On Sun, 2011-07-17 at 21:56 +0300, Kalle Valo wrote: > On 07/17/2011 09:43 PM, Joe Perches wrote: > > Joe Perches (3): > > ath6kl: Add missing newlines and coalesce messages > > ath6kl: Remove __func__ uses from ath6kl_err > > ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper > Nice, thanks a lot. I'm planning to send v3 of athk6kl patches later > today. Is it okay for you if I amend your three patches to that patchset? 'course. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] ath6kl: neatening 2011-07-17 19:52 ` Joe Perches @ 2011-07-17 20:45 ` Kalle Valo 2011-07-17 21:38 ` [PATCH 0/2] ath6kl: more neatening Joe Perches [not found] ` <4E2349D4.4000204-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org> 0 siblings, 2 replies; 11+ messages in thread From: Kalle Valo @ 2011-07-17 20:45 UTC (permalink / raw) To: Joe Perches; +Cc: devel, gregkh, error27, linux-kernel, linux-wireless, netdev On 07/17/2011 10:52 PM, Joe Perches wrote: > On Sun, 2011-07-17 at 21:56 +0300, Kalle Valo wrote: >> On 07/17/2011 09:43 PM, Joe Perches wrote: >>> Joe Perches (3): >>> ath6kl: Add missing newlines and coalesce messages >>> ath6kl: Remove __func__ uses from ath6kl_err >>> ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper >> Nice, thanks a lot. I'm planning to send v3 of athk6kl patches later >> today. Is it okay for you if I amend your three patches to that patchset? > > 'course. Great, thanks. I have now applied your patches to ath6kl-cleanup tree and they will be included in patchset v3. Kalle ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/2] ath6kl: more neatening 2011-07-17 20:45 ` Kalle Valo @ 2011-07-17 21:38 ` Joe Perches 2011-07-17 21:38 ` [PATCH 1/2] ath6kl: Remove __func__ uses from ath6kl_dbg Joe Perches 2011-07-17 21:49 ` [PATCH 0/2] ath6kl: more neatening Kalle Valo [not found] ` <4E2349D4.4000204-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org> 1 sibling, 2 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 21:38 UTC (permalink / raw) To: Kalle Valo; +Cc: netdev, gregkh, linux-wireless, linux-kernel, devel > Great, thanks. I have now applied your patches to ath6kl-cleanup tree > and they will be included in patchset v3. Here's a couple of more. Joe Perches (2): ath6kl: Remove __func__ uses from ath6kl_dbg ath6kl: Remove trailing unpaired close paren from ath6kl_err uses drivers/net/wireless/ath/ath6kl/bmi.c | 4 +- drivers/net/wireless/ath/ath6kl/cfg80211.c | 101 ++++++++++++--------------- drivers/net/wireless/ath/ath6kl/debug.c | 20 +++--- drivers/net/wireless/ath/ath6kl/debug.h | 27 ++++---- drivers/net/wireless/ath/ath6kl/htc.c | 11 ++-- drivers/net/wireless/ath/ath6kl/init.c | 8 +- drivers/net/wireless/ath/ath6kl/main.c | 13 ++-- drivers/net/wireless/ath/ath6kl/sdio.c | 12 ++-- drivers/net/wireless/ath/ath6kl/txrx.c | 30 ++++----- drivers/net/wireless/ath/ath6kl/wmi.c | 8 +-- 10 files changed, 107 insertions(+), 127 deletions(-) -- 1.7.6.131.g99019 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] ath6kl: Remove __func__ uses from ath6kl_dbg 2011-07-17 21:38 ` [PATCH 0/2] ath6kl: more neatening Joe Perches @ 2011-07-17 21:38 ` Joe Perches 2011-07-17 21:49 ` [PATCH 0/2] ath6kl: more neatening Kalle Valo 1 sibling, 0 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 21:38 UTC (permalink / raw) To: Kalle Valo, linux-kernel Cc: devel, gregkh, error27, linux-wireless, netdev, John W. Linville Make the ath6kl_dbg uses consistly _not_ use __func__. Add __func__ to #define ath6kl_dbg. Remove __func__ from single ath6kl_err. Signed-off-by: Joe Perches <joe@perches.com> --- drivers/net/wireless/ath/ath6kl/bmi.c | 4 +- drivers/net/wireless/ath/ath6kl/cfg80211.c | 101 ++++++++++++--------------- drivers/net/wireless/ath/ath6kl/debug.c | 20 +++--- drivers/net/wireless/ath/ath6kl/debug.h | 27 ++++---- drivers/net/wireless/ath/ath6kl/htc.c | 11 ++-- drivers/net/wireless/ath/ath6kl/init.c | 8 +- drivers/net/wireless/ath/ath6kl/main.c | 13 ++-- drivers/net/wireless/ath/ath6kl/sdio.c | 8 +- drivers/net/wireless/ath/ath6kl/txrx.c | 30 ++++----- drivers/net/wireless/ath/ath6kl/wmi.c | 8 +-- 10 files changed, 105 insertions(+), 125 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c index 8467669..22dd247 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.c +++ b/drivers/net/wireless/ath/ath6kl/bmi.c @@ -407,7 +407,7 @@ int ath6kl_bmi_execute(struct ath6kl *ar, u32 addr, u32 *param) } memset(ar->bmi.cmd_buf, 0, size); - ath6kl_dbg(ATH6KL_DBG_BMI, "bmi execute: addr: 0x%x, param: %d)\n", + ath6kl_dbg(ATH6KL_DBG_BMI, "bmi execute: addr: 0x%x, param: %d\n", addr, *param); offset = 0; @@ -575,7 +575,7 @@ int ath6kl_bmi_lz_data(struct ath6kl *ar, u8 *buf, u32 len) } memset(ar->bmi.cmd_buf, 0, size); - ath6kl_dbg(ATH6KL_DBG_BMI, "bmi send LZ data: len: %d)\n", + ath6kl_dbg(ATH6KL_DBG_BMI, "bmi send LZ data: len: %d\n", len); len_remain = len; diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 71515bb..6c7970f 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -118,7 +118,7 @@ static struct ieee80211_supported_band ath6kl_band_5ghz = { static int ath6kl_set_wpa_version(struct ath6kl *ar, enum nl80211_wpa_versions wpa_version) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: %u\n", __func__, wpa_version); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "wpa version: %u\n", wpa_version); if (!wpa_version) { ar->auth_mode = NONE_AUTH; @@ -127,7 +127,7 @@ static int ath6kl_set_wpa_version(struct ath6kl *ar, } else if (wpa_version & NL80211_WPA_VERSION_2) { ar->auth_mode = WPA2_AUTH; } else { - ath6kl_err("%s: %u not supported\n", __func__, wpa_version); + ath6kl_err("wpa version %u not supported\n", wpa_version); return -ENOTSUPP; } @@ -138,7 +138,7 @@ static int ath6kl_set_auth_type(struct ath6kl *ar, enum nl80211_auth_type auth_type) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: 0x%x\n", __func__, auth_type); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "auth type: 0x%x\n", auth_type); switch (auth_type) { case NL80211_AUTHTYPE_OPEN_SYSTEM: @@ -158,7 +158,7 @@ static int ath6kl_set_auth_type(struct ath6kl *ar, default: ar->dot11_auth_mode = OPEN_AUTH; - ath6kl_err("%s: 0x%x not spported\n", __func__, auth_type); + ath6kl_err("auth type 0x%x not supported\n", auth_type); return -ENOTSUPP; } @@ -170,8 +170,8 @@ static int ath6kl_set_cipher(struct ath6kl *ar, u32 cipher, bool ucast) u8 *ar_cipher = ucast ? &ar->prwise_crypto : &ar->grp_crypto; u8 *ar_cipher_len = ucast ? &ar->prwise_crypto_len : &ar->grp_crpto_len; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: cipher 0x%x, ucast %u\n", - __func__, cipher, ucast); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "cipher 0x%x, ucast %u\n", + cipher, ucast); switch (cipher) { case 0: @@ -205,7 +205,7 @@ static int ath6kl_set_cipher(struct ath6kl *ar, u32 cipher, bool ucast) static void ath6kl_set_key_mgmt(struct ath6kl *ar, u32 key_mgmt) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: 0x%x\n", __func__, key_mgmt); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "set key: 0x%x\n", key_mgmt); if (key_mgmt == WLAN_AKM_SUITE_PSK) { if (ar->auth_mode == WPA_AUTH) @@ -365,10 +365,9 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ar->nw_type = ar->next_mode; ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: connect called with authmode %d dot11 auth %d" + "connect called with authmode %d dot11 auth %d" " PW crypto %d PW crypto len %d GRP crypto %d" " GRP crypto len %d channel hint %u\n", - __func__, ar->auth_mode, ar->dot11_auth_mode, ar->prwise_crypto, ar->prwise_crypto_len, ar->grp_crypto, ar->grp_crpto_len, ar->ch_hint); @@ -447,7 +446,7 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel, if (nw_type & ADHOC_NETWORK) { if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: ath6k not in ibss mode\n", __func__); + "ath6k not in ibss mode\n"); return; } } @@ -455,7 +454,7 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel, if (nw_type & INFRA_NETWORK) { if (ar->wdev->iftype != NL80211_IFTYPE_STATION) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: ath6k not in station mode\n", __func__); + "ath6k not in station mode\n"); return; } } @@ -545,9 +544,8 @@ void ath6kl_cfg80211_connect_event(struct ath6kl *ar, u16 channel, ibss_ch = ieee80211_get_channel(ar->wdev->wiphy, (int)channel); ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: inform bss with bssid %pM channel %d beacon_intvl %d capability 0x%x\n", - __func__, mgmt->bssid, ibss_ch->hw_value, - beacon_intvl, capability); + "inform bss with bssid %pM channel %d beacon_intvl %d capability 0x%x\n", + mgmt->bssid, ibss_ch->hw_value, beacon_intvl, capability); bss = cfg80211_inform_bss_frame(ar->wdev->wiphy, ibss_ch, mgmt, @@ -580,8 +578,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy, { struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(dev); - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: reason=%u\n", __func__, - reason_code); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "disconnect reason=%u\n", reason_code); if (!ath6kl_cfg80211_ready(ar)) return -EIO; @@ -624,7 +621,7 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason, if (ar->nw_type & ADHOC_NETWORK) { if (ar->wdev->iftype != NL80211_IFTYPE_ADHOC) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: ath6k not in ibss mode\n", __func__); + "ath6k not in ibss mode\n"); return; } memset(bssid, 0, ETH_ALEN); @@ -635,7 +632,7 @@ void ath6kl_cfg80211_disconnect_event(struct ath6kl *ar, u8 reason, if (ar->nw_type & INFRA_NETWORK) { if (ar->wdev->iftype != NL80211_IFTYPE_STATION) { ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: ath6k not in station mode\n", __func__); + "ath6k not in station mode\n"); return; } } @@ -767,7 +764,7 @@ static void ath6kl_cfg80211_scan_node(void *arg, struct bss *ni) signal = ni->ni_snr * 100; ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: bssid %pM ch %d freq %d size %d\n", __func__, + "bssid %pM ch %d freq %d size %d\n", mgmt->bssid, channel->hw_value, freq, size); cfg80211_inform_bss_frame(wiphy, channel, mgmt, size, signal, GFP_KERNEL); @@ -825,7 +822,7 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev, void ath6kl_cfg80211_scan_complete_event(struct ath6kl *ar, int status) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: status %d\n", __func__, status); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "scan complete status %d\n", status); if (ar->scan_req) { /* Translate data to cfg80211 mgmt format */ @@ -864,8 +861,7 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, return -EIO; if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: key index %d out of bounds\n", __func__, + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d out of bounds\n", key_index); return -ENOENT; } @@ -914,9 +910,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, del_timer(&ar->disconnect_timer); ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: index %d, key_len %d, key_type 0x%x, key_usage 0x%x, seq_len %d\n", - __func__, key_index, key->key_len, key_type, - key_usage, key->seq_len); + "index %d, key_len %d, key_type 0x%x, key_usage 0x%x, seq_len %d\n", + key_index, key->key_len, key_type, key_usage, key->seq_len); ar->def_txkey_index = key_index; status = ath6kl_wmi_addkey_cmd(ar->wmi, ar->def_txkey_index, @@ -936,21 +931,20 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, { struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev); - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "del key index %d\n", key_index); if (!ath6kl_cfg80211_ready(ar)) return -EIO; if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: key index %d out of bounds\n", __func__, + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d out of bounds\n", key_index); return -ENOENT; } if (!ar->keys[key_index].key_len) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: index %d is empty\n", __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d is empty\n", + key_index); return 0; } @@ -969,14 +963,13 @@ static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, struct ath6kl_key *key = NULL; struct key_params params; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d\n", key_index); if (!ath6kl_cfg80211_ready(ar)) return -EIO; if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: key index %d out of bounds\n", __func__, + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d out of bounds\n", key_index); return -ENOENT; } @@ -1004,21 +997,20 @@ static int ath6kl_cfg80211_set_default_key(struct wiphy *wiphy, int status = 0; u8 key_usage; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "default key index %d\n", key_index); if (!ath6kl_cfg80211_ready(ar)) return -EIO; if (key_index < WMI_MIN_KEY_INDEX || key_index > WMI_MAX_KEY_INDEX) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: key index %d out of bounds\n", - __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "key index %d out of bounds\n", + key_index); return -ENOENT; } if (!ar->keys[key_index].key_len) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: invalid key index %d\n", - __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "invalid key index %d\n", + key_index); return -EINVAL; } @@ -1045,20 +1037,20 @@ static int ath6kl_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, { struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev); - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "mgmt index %d\n", key_index); if (!ath6kl_cfg80211_ready(ar)) return -EIO; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: not supported\n", __func__); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "mgnt index not supported\n"); return -ENOTSUPP; } void ath6kl_cfg80211_tkip_micerr_event(struct ath6kl *ar, u8 keyid, bool ismcast) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: keyid %d, ismcast %d\n", __func__, keyid, ismcast); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "keyid %d, ismcast %d\n", + keyid, ismcast); cfg80211_michael_mic_failure(ar->net_dev, ar->bssid, (ismcast ? NL80211_KEYTYPE_GROUP : @@ -1071,8 +1063,7 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed) struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy); int ret; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: changed 0x%x\n", __func__, - changed); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "wiphy changed 0x%x\n", changed); if (!ath6kl_cfg80211_ready(ar)) return -EIO; @@ -1099,8 +1090,7 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy, struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy); u8 ath6kl_dbm; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x, dbm %d\n", __func__, - type, dbm); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "type 0x%x, dbm %d\n", type, dbm); if (!ath6kl_cfg80211_ready(ar)) return -EIO; @@ -1112,8 +1102,8 @@ static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy, ar->tx_pwr = ath6kl_dbm = dbm; break; default: - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x not supported\n", - __func__, type); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "type 0x%x not supported\n", + type); return -EOPNOTSUPP; } @@ -1157,17 +1147,17 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct ath6kl *ar = ath6kl_priv(dev); struct wmi_power_mode_cmd mode; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: pmgmt %d, timeout %d\n", - __func__, pmgmt, timeout); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "pmgmt %d, timeout %d\n", + pmgmt, timeout); if (!ath6kl_cfg80211_ready(ar)) return -EIO; if (pmgmt) { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: max perf\n", __func__); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "max perf\n"); mode.pwr_mode = REC_POWER; } else { - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: rec power\n", __func__); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "rec power\n"); mode.pwr_mode = MAX_PERF_POWER; } @@ -1187,7 +1177,7 @@ static int ath6kl_cfg80211_change_iface(struct wiphy *wiphy, struct ath6kl *ar = ath6kl_priv(ndev); struct wireless_dev *wdev = ar->wdev; - ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type %u\n", __func__, type); + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "iface type %u\n", type); if (!ath6kl_cfg80211_ready(ar)) return -EIO; @@ -1258,10 +1248,9 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy, ar->nw_type = ar->next_mode; ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, - "%s: connect called with authmode %d dot11 auth %d" + "connect called with authmode %d dot11 auth %d" " PW crypto %d PW crypto len %d GRP crypto %d" " GRP crypto len %d channel hint %u\n", - __func__, ar->auth_mode, ar->dot11_auth_mode, ar->prwise_crypto, ar->prwise_crypto_len, ar->grp_crypto, ar->grp_crpto_len, ar->ch_hint); diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c index 316136c..b30d583 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.c +++ b/drivers/net/wireless/ath/ath6kl/debug.c @@ -41,33 +41,33 @@ void ath6kl_dump_registers(struct ath6kl_device *dev, struct ath6kl_irq_enable_reg *irq_enable_reg) { - ath6kl_dbg(ATH6KL_DBG_ANY, ("<------- Register Table -------->\n")); + ath6kl_dbg(ATH6KL_DBG_ANY, "<------- Register Table -------->\n"); if (irq_proc_reg != NULL) { ath6kl_dbg(ATH6KL_DBG_ANY, - "Host Int status: 0x%x\n", - irq_proc_reg->host_int_status); + "Host Int status: 0x%x\n", + irq_proc_reg->host_int_status); ath6kl_dbg(ATH6KL_DBG_ANY, "CPU Int status: 0x%x\n", - irq_proc_reg->cpu_int_status); + irq_proc_reg->cpu_int_status); ath6kl_dbg(ATH6KL_DBG_ANY, "Error Int status: 0x%x\n", - irq_proc_reg->error_int_status); + irq_proc_reg->error_int_status); ath6kl_dbg(ATH6KL_DBG_ANY, "Counter Int status: 0x%x\n", - irq_proc_reg->counter_int_status); + irq_proc_reg->counter_int_status); ath6kl_dbg(ATH6KL_DBG_ANY, "Mbox Frame: 0x%x\n", - irq_proc_reg->mbox_frame); + irq_proc_reg->mbox_frame); ath6kl_dbg(ATH6KL_DBG_ANY, "Rx Lookahead Valid: 0x%x\n", - irq_proc_reg->rx_lkahd_valid); + irq_proc_reg->rx_lkahd_valid); ath6kl_dbg(ATH6KL_DBG_ANY, "Rx Lookahead 0: 0x%x\n", - irq_proc_reg->rx_lkahd[0]); + irq_proc_reg->rx_lkahd[0]); ath6kl_dbg(ATH6KL_DBG_ANY, "Rx Lookahead 1: 0x%x\n", - irq_proc_reg->rx_lkahd[1]); + irq_proc_reg->rx_lkahd[1]); if (dev->ar->mbox_info.gmbox_addr != 0) { /* diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h index 2e60588..ece20c9 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.h +++ b/drivers/net/wireless/ath/ath6kl/debug.h @@ -42,7 +42,7 @@ extern unsigned int debug_mask; extern int ath6kl_printk(const char *level, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); -#define ath6kl_info(fmt, ...) \ +#define ath6kl_info(fmt, ...) \ ath6kl_printk(KERN_INFO, fmt, ##__VA_ARGS__) #define ath6kl_err(fmt, ...) \ ath6kl_printk(KERN_ERR, fmt, ##__VA_ARGS__) @@ -52,16 +52,17 @@ extern int ath6kl_printk(const char *level, const char *fmt, ...) #define AR_DBG_LVL_CHECK(mask) (debug_mask & mask) #ifdef CONFIG_ATH6KL_DEBUG -#define ath6kl_dbg(mask, fmt, ...) \ - ({ \ - int rtn; \ - if (debug_mask & mask) \ - rtn = ath6kl_printk(KERN_DEBUG, fmt, ##__VA_ARGS__); \ - else \ - rtn = 0; \ - \ - rtn; \ - }) +#define ath6kl_dbg(mask, fmt, ...) \ +({ \ + int rtn; \ + if (debug_mask & mask) \ + rtn = ath6kl_printk(KERN_DEBUG, "%s: " fmt, \ + __func__, ##__VA_ARGS__); \ + else \ + rtn = 0; \ + \ + rtn; \ +}) static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, const char *msg, const void *buf, @@ -78,8 +79,8 @@ void ath6kl_dump_registers(struct ath6kl_device *dev, struct ath6kl_irq_enable_reg *irq_en_reg); void dump_cred_dist_stats(struct htc_target *target); #else -static inline int ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask, - const char *fmt, ...) +static inline __attribute__ ((format (printf, 2, 3))) +int ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask, const char *fmt, ...) { return 0; } diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index 95c47bb..ab651fb 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.c +++ b/drivers/net/wireless/ath/ath6kl/htc.c @@ -175,16 +175,15 @@ static int htc_issue_send(struct htc_target *target, struct htc_packet *packet) send_len = packet->act_len + HTC_HDR_LENGTH; - ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "%s: transmit len : %d (%s)\n", - __func__, send_len, sync ? "sync" : "async"); + ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "transmit len : %d (%s)\n", + send_len, sync ? "sync" : "async"); padded_len = CALC_TXRX_PADDED_LEN(target->dev, send_len); ath6kl_dbg(ATH6KL_DBG_HTC_SEND, - "DevSendPacket, padded len: %d mbox:0x%X (mode:%s)\n", - padded_len, - target->dev->ar->mbox_info.htc_addr, - sync ? "sync" : "async"); + "DevSendPacket, padded len: %d mbox:0x%X (mode:%s)\n", + padded_len, target->dev->ar->mbox_info.htc_addr, + sync ? "sync" : "async"); if (sync) { status = hif_read_write_sync(target->dev->ar, diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index fe61871..a8f4452 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -1060,7 +1060,7 @@ static int ath6kl_init(struct net_device *dev) goto ath6kl_init_done; } - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi); + ath6kl_dbg(ATH6KL_DBG_TRC, "got wmi @ 0x%p\n", ar->wmi); /* * The reason we have to wait for the target here is that the @@ -1122,7 +1122,7 @@ static int ath6kl_init(struct net_device *dev) goto err_htc_stop; } - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__); + ath6kl_dbg(ATH6KL_DBG_TRC, "wmi is ready\n"); /* communicate the wmi protocol verision to the target */ if ((ath6kl_set_host_app_area(ar)) != 0) @@ -1208,8 +1208,8 @@ int ath6kl_core_init(struct ath6kl *ar) set_bit(NETDEV_REGISTERED, &ar->flag); - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n", - __func__, ar->net_dev->name, ar->net_dev, ar); + ath6kl_dbg(ATH6KL_DBG_TRC, "name=%s dev=0x%p, ar=0x%p\n", + ar->net_dev->name, ar->net_dev, ar); return ret; diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index f325a23..6ef26a3 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -359,14 +359,12 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile, ar->user_key_ctrl = 0; } else { - ath6kl_dbg(ATH6KL_DBG_TRC, - "%s: wmi is not ready 0x%p 0x%p\n", - __func__, ar, ar->wmi); + ath6kl_dbg(ATH6KL_DBG_TRC, "wmi is not ready 0x%p 0x%p\n", + ar, ar->wmi); /* Shut down WMI if we have started it */ if (test_bit(WMI_ENABLED, &ar->flag)) { - ath6kl_dbg(ATH6KL_DBG_TRC, - "%s: shut down wmi\n", __func__); + ath6kl_dbg(ATH6KL_DBG_TRC, "shut down wmi\n"); ath6kl_wmi_shutdown(ar->wmi); clear_bit(WMI_ENABLED, &ar->flag); ar->wmi = NULL; @@ -374,7 +372,7 @@ void ath6kl_stop_endpoint(struct net_device *dev, bool keep_profile, } if (ar->htc_target) { - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: shut down htc\n", __func__); + ath6kl_dbg(ATH6KL_DBG_TRC, "shut down htc\n"); htc_stop(ar->htc_target); } @@ -801,8 +799,7 @@ void ath6kl_ready_event(void *devt, u8 *datap, u32 sw_ver, u32 abi_ver) struct net_device *dev = ar->net_dev; memcpy(dev->dev_addr, datap, ETH_ALEN); - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: mac addr = %pM\n", - __func__, dev->dev_addr); + ath6kl_dbg(ATH6KL_DBG_TRC, "mac addr = %pM\n", dev->dev_addr); ar->version.wlan_ver = sw_ver; ar->version.abi_ver = abi_ver; diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index b38732a..c58a107 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -145,7 +145,7 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio) list_del(&bus_req->list); spin_unlock_irqrestore(&ar_sdio->lock, flag); - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req); + ath6kl_dbg(ATH6KL_DBG_TRC, "bus request 0x%p\n", bus_req); return bus_req; } @@ -155,7 +155,7 @@ static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio, { unsigned long flag; - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req); + ath6kl_dbg(ATH6KL_DBG_TRC, "bus request 0x%p\n", bus_req); spin_lock_irqsave(&ar_sdio->lock, flag); list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq); @@ -683,8 +683,8 @@ static int ath6kl_sdio_probe(struct sdio_func *func, int count; ath6kl_dbg(ATH6KL_DBG_TRC, - "%s: func: 0x%X, vendor id: 0x%X, dev id: 0x%X, block size: 0x%X/0x%X\n", - __func__, func->num, func->vendor, + "func: 0x%X, vendor id: 0x%X, dev id: 0x%X, block size: 0x%X/0x%X\n", + func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize); ar_sdio = kzalloc(sizeof(struct ath6kl_sdio), GFP_KERNEL); diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index 615b46d..e2e3673 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -184,8 +184,7 @@ int ath6kl_control_tx(void *devt, struct sk_buff *skb, spin_lock_bh(&ar->lock); - ath6kl_dbg(ATH6KL_DBG_WLAN_TX, - "%s: skb=0x%p, len=0x%x eid =%d\n", __func__, + ath6kl_dbg(ATH6KL_DBG_WLAN_TX, "skb=0x%p, len=0x%x eid=%d\n", skb, skb->len, eid); if (test_bit(WMI_CTRL_EP_FULL, &ar->flag) && (eid == ar->ctrl_ep)) { @@ -242,8 +241,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev) struct wmi_tx_meta_v2 meta_v2; int ret; - ath6kl_dbg(ATH6KL_DBG_WLAN_TX, - "%s: skb=0x%p, data=0x%p, len=0x%x\n", __func__, + ath6kl_dbg(ATH6KL_DBG_WLAN_TX, "skb=0x%p, data=0x%p, len=0x%x\n", skb, skb->data, skb->len); /* If target is not associated */ @@ -563,13 +561,13 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue) if (status != -ENOSPC) ath6kl_err("tx error, status: 0x%x\n", status); ath6kl_dbg(ATH6KL_DBG_WLAN_TX, - "%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n", - __func__, skb, packet->buf, packet->act_len, + "skb=0x%p data=0x%p len=0x%x eid=%d %s\n", + skb, packet->buf, packet->act_len, eid, "error!"); } else { ath6kl_dbg(ATH6KL_DBG_WLAN_TX, - "%s: skb=0x%p data=0x%p len=0x%x eid=%d %s\n", - __func__, skb, packet->buf, packet->act_len, + "skb=0x%p data=0x%p len=0x%x eid=%d %s\n", + skb, packet->buf, packet->act_len, eid, "OK"); flushing = false; @@ -680,8 +678,8 @@ void ath6kl_rx_refill(struct htc_target *target, enum htc_endpoint_id endpoint) INIT_LIST_HEAD(&queue); ath6kl_dbg(ATH6KL_DBG_WLAN_RX, - "%s: providing htc with %d buffers at eid=%d\n", - __func__, n_buf_refill, endpoint); + "providing htc with %d buffers at eid=%d\n", + n_buf_refill, endpoint); for (rx_buf = 0; rx_buf < n_buf_refill; rx_buf++) { skb = ath6kl_buf_alloc(ATH6KL_BUFFER_SIZE); @@ -731,8 +729,7 @@ struct htc_packet *ath6kl_alloc_amsdu_rxbuf(struct htc_target *target, struct list_head *pkt_pos; int refill_cnt = 0, depth = 0; - ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "%s: eid=%d, len:%d\n", - __func__, endpoint, len); + ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "eid=%d, len:%d\n", endpoint, len); if ((len <= ATH6KL_BUFFER_SIZE) || (len > ATH6KL_AMSDU_BUFFER_SIZE)) @@ -1025,9 +1022,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet) u8 tid; ath6kl_dbg(ATH6KL_DBG_WLAN_RX, - "%s: ar=0x%p eid=%d, skb=0x%p, data=0x%p, len=0x%x status:%d", - __func__, ar, ept, skb, packet->buf, - packet->act_len, status); + "ar=0x%p eid=%d, skb=0x%p, data=0x%p, len=0x%x status:%d\n", + ar, ept, skb, packet->buf, packet->act_len, status); if (status || !(skb->data + HTC_HDR_LENGTH)) { ar->net_stats.rx_errors++; @@ -1324,8 +1320,8 @@ void aggr_recv_addba_req_evt(struct ath6kl *ar, u8 tid, u16 seq_no, u8 win_sz) stats = &p_aggr->stat[tid]; if (win_sz < AGGR_WIN_SZ_MIN || win_sz > AGGR_WIN_SZ_MAX) - ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "%s: win_sz %d, tid %d\n", - __func__, win_sz, tid); + ath6kl_dbg(ATH6KL_DBG_WLAN_RX, "win_sz %d, tid %d\n", + win_sz, tid); if (rxtid->aggr) aggr_delete_tid_state(p_aggr, tid); diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index a52d7d2..29790e5 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -102,8 +102,7 @@ int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb) type = eth_hdr->h_proto; if (!is_ethertype(be16_to_cpu(type))) { - ath6kl_dbg(ATH6KL_DBG_WMI, - "%s: pkt is already in 802.3 format\n", __func__); + ath6kl_dbg(ATH6KL_DBG_WMI, "pkt is already in 802.3 format\n"); return 0; } @@ -496,8 +495,7 @@ static int ath6kl_wmi_connect_event_rx(struct wmi *wmi, u8 *datap, int len) ev = (struct wmi_connect_event *) datap; - ath6kl_dbg(ATH6KL_DBG_WMI, "%s: freq %d bssid %pM\n", - __func__, ev->ch, ev->bssid); + ath6kl_dbg(ATH6KL_DBG_WMI, "freq %d bssid %pM\n", ev->ch, ev->bssid); memcpy(wmi->bssid, ev->bssid, ETH_ALEN); @@ -2545,7 +2543,7 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) datap = skb->data; len = skb->len; - ath6kl_dbg(ATH6KL_DBG_WMI, "%s: wmi id: %d\n", __func__, id); + ath6kl_dbg(ATH6KL_DBG_WMI, "wmi id: %d\n", id); ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", datap, len); switch (id) { -- 1.7.6.131.g99019 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] ath6kl: more neatening 2011-07-17 21:38 ` [PATCH 0/2] ath6kl: more neatening Joe Perches 2011-07-17 21:38 ` [PATCH 1/2] ath6kl: Remove __func__ uses from ath6kl_dbg Joe Perches @ 2011-07-17 21:49 ` Kalle Valo 1 sibling, 0 replies; 11+ messages in thread From: Kalle Valo @ 2011-07-17 21:49 UTC (permalink / raw) To: Joe Perches; +Cc: devel, gregkh, error27, linux-kernel, linux-wireless, netdev On 07/18/2011 12:38 AM, Joe Perches wrote: >> Great, thanks. I have now applied your patches to ath6kl-cleanup tree >> and they will be included in patchset v3. > > Here's a couple of more. > > Joe Perches (2): > ath6kl: Remove __func__ uses from ath6kl_dbg > ath6kl: Remove trailing unpaired close paren from ath6kl_err uses Thanks again. I just sent v3. But if I need to create v4 (I hope not) I'll include your patches. If v3 is ok, I can resend your patches to wireless-testing so that you don't need to followup. Kalle ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <4E2349D4.4000204-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>]
[parent not found: <cover.1310938421.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>]
* [PATCH 2/2] ath6kl: Remove trailing unpaired close paren from ath6kl_err uses [not found] ` <cover.1310938421.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> @ 2011-07-17 21:38 ` Joe Perches 0 siblings, 0 replies; 11+ messages in thread From: Joe Perches @ 2011-07-17 21:38 UTC (permalink / raw) To: Kalle Valo, linux-kernel-u79uwXL29TY76Z2rM5mHXA Cc: devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X, gregkh-l3A5Bk7waGM, error27-Re5JQEeQqe8AvxtiuMwx3w, linux-wireless-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA, John W. Linville Unpaired parentheses are unsightly. Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org> --- drivers/net/wireless/ath/ath6kl/sdio.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index c58a107..e399b17 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -511,7 +511,7 @@ static int ath6kl_sdio_power_on(struct ath6kl_sdio *ar_sdio) ret = sdio_enable_func(func); if (ret) { - ath6kl_err("Unable to enable sdio func: %d)\n", ret); + ath6kl_err("Unable to enable sdio func: %d\n", ret); sdio_release_host(func); return ret; } @@ -760,7 +760,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func, ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE); if (ret) { - ath6kl_err("Set sdio block size %d failed: %d)\n", + ath6kl_err("Set sdio block size %d failed: %d\n", HIF_MBOX_BLOCK_SIZE, ret); sdio_release_host(func); goto err_off; -- 1.7.6.131.g99019 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-07-17 21:49 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17 18:43 [PATCH 0/3] ath6kl: neatening Joe Perches
2011-07-17 18:43 ` [PATCH 1/3] ath6kl: Add missing newlines and coalesce messages Joe Perches
2011-07-17 18:43 ` [PATCH 2/3] ath6kl: Remove __func__ uses from ath6kl_err Joe Perches
2011-07-17 18:43 ` [PATCH 3/3] ath6kl: cfg80211: Add and use ath6kl_cfg80211_ready helper Joe Perches
2011-07-17 18:56 ` [PATCH 0/3] ath6kl: neatening Kalle Valo
2011-07-17 19:52 ` Joe Perches
2011-07-17 20:45 ` Kalle Valo
2011-07-17 21:38 ` [PATCH 0/2] ath6kl: more neatening Joe Perches
2011-07-17 21:38 ` [PATCH 1/2] ath6kl: Remove __func__ uses from ath6kl_dbg Joe Perches
2011-07-17 21:49 ` [PATCH 0/2] ath6kl: more neatening Kalle Valo
[not found] ` <4E2349D4.4000204-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
[not found] ` <cover.1310938421.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2011-07-17 21:38 ` [PATCH 2/2] ath6kl: Remove trailing unpaired close paren from ath6kl_err uses Joe Perches
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).