From 3da95b1067bacf2ae3dce3487150029d0dfd6b98 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 10 Jul 2007 02:21:15 -0400 Subject: [PATCH] Use __func__ in debug messages It's more standard than __FUNCTION__. Also fix some cases when the function name is hardcoded in the debug messages. Signed-off-by: Pavel Roskin --- at76_usb.c | 99 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/at76_usb.c b/at76_usb.c index 2cc781f..98d3ebb 100644 --- a/at76_usb.c +++ b/at76_usb.c @@ -226,7 +226,7 @@ static int at76_load_int_fw_block(struct usb_device *udev, int blockno, { int ret; - at76_dbg(DBG_DFU, "dfu_download_block(): block=%p, size=%d, blockno=%d", + at76_dbg(DBG_DFU, "%s(): block=%p, size=%d, blockno=%d", __func__, block, size, blockno); ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), DFU_DNLOAD, @@ -283,7 +283,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *dfu_buffer, int dfu_buffer_offset = 0; int dfu_block_cnt = 0; - at76_dbg(DBG_DFU, "%s( %p, %u, %d)", __FUNCTION__, dfu_buffer, + at76_dbg(DBG_DFU, "%s( %p, %u, %d)", __func__, dfu_buffer, dfu_len, manifest_sync_timeout); if (dfu_len == 0) { @@ -422,7 +422,7 @@ static inline void at76_iwevent_bss_connect(struct net_device *netdev, wrqu.ap_addr.sa_family = ARPHRD_ETHER; wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL); at76_dbg(DBG_WE_EVENTS, "%s: %s: SIOCGIWAP sent", netdev->name, - __FUNCTION__); + __func__); } static inline void at76_iwevent_bss_disconnect(struct net_device *netdev) @@ -434,7 +434,7 @@ static inline void at76_iwevent_bss_disconnect(struct net_device *netdev) wrqu.ap_addr.sa_family = ARPHRD_ETHER; wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL); at76_dbg(DBG_WE_EVENTS, "%s: %s: SIOCGIWAP sent", netdev->name, - __FUNCTION__); + __func__); } #define HEX2STR_BUFFERS 4 @@ -1324,7 +1324,7 @@ static void at76_dump_mib_mdomain(struct at76_priv *priv) ret = at76_get_mib_mdomain(priv, &mdomain); if (ret < 0) { - err("%s: at76_get_mib_mdomain returned %d", __FUNCTION__, ret); + err("%s: at76_get_mib_mdomain returned %d", __func__, ret); return; } @@ -1584,7 +1584,7 @@ static void at76_write_bulk_callback(struct urb *urb) if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) { at76_dbg(DBG_URB, "%s - nonzero write bulk status received: %d", - __FUNCTION__, urb->status); + __func__, urb->status); } else return; /* urb has been unlinked */ stats->tx_errors++; @@ -1609,7 +1609,7 @@ static void at76_write_bulk_callback(struct urb *urb) ret = usb_submit_urb(priv->write_urb, GFP_ATOMIC); if (ret) { err("%s: %s error in tx submit urb: %d", - priv->netdev->name, __FUNCTION__, ret); + priv->netdev->name, __func__, ret); } kfree(mgmt_buf); } else @@ -1644,7 +1644,7 @@ static int at76_send_mgmt_bulk(struct at76_priv *priv, if this is no error in some situations we must implement a queue or silently modify the old msg */ err("%s: %s removed pending mgmt buffer %s", - priv->netdev->name, __FUNCTION__, + priv->netdev->name, __func__, hex2str(priv->next_mgmt_bulk, 64)); kfree(priv->next_mgmt_bulk); } @@ -1656,7 +1656,7 @@ static int at76_send_mgmt_bulk(struct at76_priv *priv, if (priv->next_mgmt_bulk) { err("%s: %s URB status %d, but mgmt is pending", - priv->netdev->name, __FUNCTION__, urb_status); + priv->netdev->name, __func__, urb_status); } at76_dbg(DBG_TX_MGMT, @@ -1676,7 +1676,7 @@ static int at76_send_mgmt_bulk(struct at76_priv *priv, ret = usb_submit_urb(priv->write_urb, GFP_ATOMIC); if (ret) { err("%s: %s error in tx submit urb: %d", - priv->netdev->name, __FUNCTION__, ret); + priv->netdev->name, __func__, ret); } kfree(txbuf); } @@ -2004,28 +2004,28 @@ static void at76_handle_mgmt_timeout_scan(struct at76_priv *priv) status = at76_get_cmd_status(priv->udev, CMD_SCAN); if (status < 0) { err("%s: %s: at76_get_cmd_status failed with %d", - priv->netdev->name, __FUNCTION__, status); + priv->netdev->name, __func__, status); status = CMD_STATUS_IN_PROGRESS; /* INFO: Hope it was a one off error - if not, scanning further down the line and stop this cycle */ } at76_dbg(DBG_PROGRESS, "%s %s:%d got cmd_status %d (istate %d, " "scan_runs %d)", - priv->netdev->name, __FUNCTION__, __LINE__, status, + priv->netdev->name, __func__, __LINE__, status, priv->istate, priv->scan_runs); if (status != CMD_STATUS_COMPLETE) { if ((status != CMD_STATUS_IN_PROGRESS) && (status != CMD_STATUS_IDLE)) err("%s: %s: Bad scan status: %s", - priv->netdev->name, __FUNCTION__, + priv->netdev->name, __func__, at76_get_cmd_status_string(status)); /* the first cmd status after scan start is always a IDLE -> start the timer to poll again until COMPLETED */ at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer for %d ticks", - __FUNCTION__, __LINE__, SCAN_POLL_INTERVAL); + __func__, __LINE__, SCAN_POLL_INTERVAL); schedule_delayed_work(&priv->dwork_mgmt, SCAN_POLL_INTERVAL); return; } @@ -2050,11 +2050,11 @@ static void at76_handle_mgmt_timeout_scan(struct at76_priv *priv) ret = at76_start_scan(priv, 0, 1); if (ret < 0) { err("%s: %s: start_scan (ANY) failed with %d", - priv->netdev->name, __FUNCTION__, ret); + priv->netdev->name, __func__, ret); } at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer for %d ticks", - __FUNCTION__, __LINE__, SCAN_POLL_INTERVAL); + __func__, __LINE__, SCAN_POLL_INTERVAL); schedule_delayed_work(&priv->dwork_mgmt, SCAN_POLL_INTERVAL); break; @@ -2062,11 +2062,11 @@ static void at76_handle_mgmt_timeout_scan(struct at76_priv *priv) ret = at76_start_scan(priv, 1, 1); if (ret < 0) { err("%s: %s: start_scan (SSID) failed with %d", - priv->netdev->name, __FUNCTION__, ret); + priv->netdev->name, __func__, ret); } at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer for %d ticks", - __FUNCTION__, __LINE__, SCAN_POLL_INTERVAL); + __func__, __LINE__, SCAN_POLL_INTERVAL); schedule_delayed_work(&priv->dwork_mgmt, SCAN_POLL_INTERVAL); break; @@ -2143,7 +2143,7 @@ static void at76_delete_device(struct at76_priv *priv) /* signal to _stop() that the device is gone */ priv->device_unplugged = 1; - at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __func__); if (priv->netdev_registered) { unregister_netdev(priv->netdev); @@ -2170,7 +2170,7 @@ static void at76_delete_device(struct at76_priv *priv) usb_free_urb(priv->ctrl_urb); } - at76_dbg(DBG_PROC_ENTRY, "%s: unlinked urbs", __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: unlinked urbs", __func__); if (priv->rx_skb != NULL) kfree_skb(priv->rx_skb); @@ -2190,11 +2190,10 @@ static void at76_delete_device(struct at76_priv *priv) } usb_put_dev(priv->udev); - at76_dbg(DBG_PROC_ENTRY, "%s: before freeing priv/netdev", - __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: before freeing priv/netdev", __func__); free_netdev(priv->netdev); /* priv is in netdev */ - at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __func__); } static int at76_alloc_urbs(struct at76_priv *priv, @@ -2205,9 +2204,9 @@ static int at76_alloc_urbs(struct at76_priv *priv, int i, buffer_size; struct usb_host_interface *iface_desc; - at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __func__); - at76_dbg(DBG_URB, "%s: NumEndpoints %d ", __FUNCTION__, + at76_dbg(DBG_URB, "%s: NumEndpoints %d ", __func__, interface->altsetting[0].desc.bNumEndpoints); iface_desc = interface->cur_altsetting; @@ -2215,7 +2214,7 @@ static int at76_alloc_urbs(struct at76_priv *priv, endpoint = &iface_desc->endpoint[i].desc; at76_dbg(DBG_URB, "%s: %d. endpoint: addr 0x%x attr 0x%x", - __FUNCTION__, + __func__, i, endpoint->bEndpointAddress, endpoint->bmAttributes); if ((endpoint->bEndpointAddress & 0x80) && @@ -2267,7 +2266,7 @@ static int at76_alloc_urbs(struct at76_priv *priv, return -ENOMEM; } - at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __FUNCTION__); + at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __func__); return 0; } @@ -2321,7 +2320,7 @@ static int at76_iw_handler_commit(struct net_device *netdev, struct at76_priv *priv = netdev_priv(netdev); unsigned long flags; at76_dbg(DBG_IOCTL, "%s %s: restarting the device", netdev->name, - __FUNCTION__); + __func__); /* TODO: stop any pending tx bulk urb */ if (priv->istate != INIT) { @@ -3657,7 +3656,7 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev) if (netif_queue_stopped(netdev)) { err("%s: %s called while netdev is stopped", netdev->name, - __FUNCTION__); + __func__); /* skip this packet */ dev_kfree_skb(skb); return 0; @@ -3665,7 +3664,7 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev) if (priv->write_urb->status == -EINPROGRESS) { err("%s: %s called while priv->write_urb is pending for tx", - netdev->name, __FUNCTION__); + netdev->name, __func__); /* skip this packet */ dev_kfree_skb(skb); return 0; @@ -3673,7 +3672,7 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev) if (skb->len < 2 * ETH_ALEN) { err("%s: %s: skb too short (%d)", priv->netdev->name, - __FUNCTION__, skb->len); + __func__, skb->len); dev_kfree_skb(skb); return 0; } @@ -3697,7 +3696,7 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev) } else { err("%s: %s: no support for non-SNAP 802.2 packets " "(DSAP 0x%02x SSAP 0x%02x cntrl 0x%02x)", - priv->netdev->name, __FUNCTION__, + priv->netdev->name, __func__, skb->data[2 * ETH_ALEN + 2], skb->data[2 * ETH_ALEN + 2 + 1], skb->data[2 * ETH_ALEN + 2 + 2]); @@ -3803,7 +3802,7 @@ static int at76_submit_rx_urb(struct at76_priv *priv) struct sk_buff *skb = priv->rx_skb; if (priv->read_urb == NULL) { - err("%s: priv->read_urb is NULL", __FUNCTION__); + err("%s: priv->read_urb is NULL", __func__); return -EFAULT; } @@ -3860,7 +3859,7 @@ static int at76_open(struct net_device *netdev) struct at76_priv *priv = netdev_priv(netdev); int ret = 0; - at76_dbg(DBG_PROC_ENTRY, "at76_open entry"); + at76_dbg(DBG_PROC_ENTRY, "%s(): entry", __func__); if (mutex_lock_interruptible(&priv->mtx)) return -EINTR; @@ -3890,7 +3889,7 @@ static int at76_open(struct net_device *netdev) schedule_delayed_work(&priv->dwork_restart, 0); - at76_dbg(DBG_PROC_ENTRY, "at76_open end"); + at76_dbg(DBG_PROC_ENTRY, "%s(): end", __func__); err: mutex_unlock(&priv->mtx); return ret < 0 ? ret : 0; @@ -3901,7 +3900,7 @@ static int at76_stop(struct net_device *netdev) struct at76_priv *priv = netdev_priv(netdev); unsigned long flags; - at76_dbg(DBG_DEVSTART, "%s: ENTER", __FUNCTION__); + at76_dbg(DBG_DEVSTART, "%s: ENTER", __func__); if (mutex_lock_interruptible(&priv->mtx)) return -EINTR; @@ -3938,7 +3937,7 @@ static int at76_stop(struct net_device *netdev) priv->open_count--; mutex_unlock(&priv->mtx); - at76_dbg(DBG_DEVSTART, "%s: EXIT", __FUNCTION__); + at76_dbg(DBG_DEVSTART, "%s: EXIT", __func__); return 0; } @@ -4265,7 +4264,7 @@ static struct bss_info *at76_match_bss(struct at76_priv *priv, /* otherwise ptr points to the struct bss_info we have chosen */ at76_dbg(DBG_BSS_TABLE, "%s %s: returned %p", priv->netdev->name, - __FUNCTION__, ptr); + __func__, ptr); return ptr; } @@ -4335,7 +4334,7 @@ static void at76_work_join(struct work_struct *work) at76_auth_req(priv, priv->curr_bss, 1, NULL); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); } goto end_join; @@ -4399,7 +4398,7 @@ static void at76_work_mgmt_timeout(struct work_struct *work) at76_auth_req(priv, priv->curr_bss, 1, NULL); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); } else { /* try to get next matching BSS */ @@ -4413,7 +4412,7 @@ static void at76_work_mgmt_timeout(struct work_struct *work) at76_assoc_req(priv, priv->curr_bss); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); } else { /* jal: TODO: we may be authenticated to several @@ -4437,7 +4436,7 @@ static void at76_work_mgmt_timeout(struct work_struct *work) at76_disassoc_req(priv, priv->curr_bss); } at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); break; @@ -4446,7 +4445,7 @@ static void at76_work_mgmt_timeout(struct work_struct *work) at76_disassoc_req(priv, priv->curr_bss); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); } else { /* we scan again ... */ @@ -4668,11 +4667,11 @@ static void at76_work_scan(struct work_struct *work) ret = at76_start_scan(priv, 0, 1); if (ret < 0) { err("%s: %s: start_scan failed with %d", - priv->netdev->name, __FUNCTION__, ret); + priv->netdev->name, __func__, ret); } else { at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer for %d ticks", - __FUNCTION__, __LINE__, SCAN_POLL_INTERVAL); + __func__, __LINE__, SCAN_POLL_INTERVAL); schedule_delayed_work(&priv->dwork_mgmt, SCAN_POLL_INTERVAL); } @@ -4904,7 +4903,7 @@ static void at76_rx_mgmt_auth(struct at76_priv *priv, at76_assoc_req(priv, priv->curr_bss); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); return; } @@ -4913,7 +4912,7 @@ static void at76_rx_mgmt_auth(struct at76_priv *priv, at76_auth_req(priv, priv->curr_bss, seq_nr + 1, resp->info_element); at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", - __FUNCTION__, __LINE__); + __func__, __LINE__); schedule_delayed_work(&priv->dwork_mgmt, HZ); } /* else: ignore AuthFrames to other recipients */ @@ -5301,7 +5300,7 @@ static void at76_ieee80211_to_eth(struct sk_buff *skb, int iw_mode) i802_11_hdr = (struct ieee80211_hdr_3addr *)skb->data; - dbg("%s: ENTRY skb len %d data %s", __FUNCTION__, + dbg("%s: ENTRY skb len %d data %s", __func__, skb->len, hex2str(skb->data, 64)); skb_pull(skb, sizeof(struct ieee80211_hdr_3addr)); @@ -5367,7 +5366,7 @@ static void at76_ieee80211_to_eth(struct sk_buff *skb, int iw_mode) } dbg("%s: EXIT skb da %s sa %s proto 0x%04x len %d data %s", - __FUNCTION__, mac2str(eth_hdr(skb)->h_dest), + __func__, mac2str(eth_hdr(skb)->h_dest), mac2str(eth_hdr(skb)->h_source), ntohs(skb->protocol), skb->len, hex2str(skb->data, 64)); } @@ -5768,7 +5767,7 @@ static void at76_rx_tasklet(unsigned long param) if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) { at76_dbg(DBG_URB, "%s %s: - nonzero read bulk status received: %d", - __FUNCTION__, netdev->name, urb->status); + __func__, netdev->name, urb->status); goto no_more_urb; } return; -- cgit v1.2.3