aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm72xx/gdm_wimax.c
diff options
context:
space:
mode:
authorKristina Martšenko <kristina.martsenko@gmail.com>2014-03-15 01:10:05 +0200
committerPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2014-03-16 19:53:58 -0700
commit8943a92fc257c439ffe55fb0f9896be57c58c56b (patch)
treeb6685bd14b534665cf9b4df6d71730c7f0f7dfc0 /drivers/staging/gdm72xx/gdm_wimax.c
parentstaging: gdm72xx: use print_hex_dump_debug and remove debug macros (diff)
downloadlinux-dev-8943a92fc257c439ffe55fb0f9896be57c58c56b.tar.xz
linux-dev-8943a92fc257c439ffe55fb0f9896be57c58c56b.zip
staging: gdm72xx: replace printk() and debug macros with dynamic debugging
Replace printk(KERN_DEBUG ...) with netdev_dbg and dev_dbg. Remove debug macros which become unnecessary. This removes the following types of checkpatch warnings from the driver: drivers/staging/gdm72xx/gdm_sdio.c:461: WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ... Signed-off-by: Kristina Martšenko <kristina.martsenko@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Diffstat (limited to 'drivers/staging/gdm72xx/gdm_wimax.c')
-rw-r--r--drivers/staging/gdm72xx/gdm_wimax.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index dd2d807ada83..05ce2a22c220 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -62,7 +62,6 @@ static u8 gdm_wimax_macaddr[6] = {0x00, 0x0a, 0x3b, 0xf0, 0x01, 0x30};
static void gdm_wimax_ind_fsm_update(struct net_device *dev, struct fsm_s *fsm);
static void gdm_wimax_ind_if_updown(struct net_device *dev, int if_up);
-#if defined(DEBUG_SDU)
static const char *get_protocol_name(u16 protocol)
{
static char buf[32];
@@ -126,7 +125,8 @@ static const char *get_port_name(u16 port)
return buf;
}
-static void dump_eth_packet(const char *title, u8 *data, int len)
+static void dump_eth_packet(struct net_device *dev, const char *title,
+ u8 *data, int len)
{
struct iphdr *ih = NULL;
struct udphdr *uh = NULL;
@@ -148,7 +148,7 @@ static void dump_eth_packet(const char *title, u8 *data, int len)
port = ntohs(uh->dest);
}
- printk(KERN_DEBUG "[%s] len=%d, %s, %s, %s\n",
+ netdev_dbg(dev, "[%s] len=%d, %s, %s, %s\n",
title, len,
get_protocol_name(protocol),
get_ip_protocol_name(ip_protocol),
@@ -156,15 +156,13 @@ static void dump_eth_packet(const char *title, u8 *data, int len)
if (!(data[0] == 0xff && data[1] == 0xff)) {
if (protocol == ETH_P_IP)
- printk(KERN_DEBUG " src=%pI4\n", &ih->saddr);
+ netdev_dbg(dev, " src=%pI4\n", &ih->saddr);
else if (protocol == ETH_P_IPV6)
- printk(KERN_DEBUG " src=%pI6\n", &ih->saddr);
+ netdev_dbg(dev, " src=%pI6\n", &ih->saddr);
}
print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, data, len, false);
}
-#endif
-
static inline int gdm_wimax_header(struct sk_buff **pskb)
{
@@ -198,12 +196,10 @@ static void gdm_wimax_event_rcv(struct net_device *dev, u16 type, void *msg,
{
struct nic *nic = netdev_priv(dev);
- #if defined(DEBUG_HCI)
u8 *buf = (u8 *) msg;
u16 hci_cmd = (buf[0]<<8) | buf[1];
u16 hci_len = (buf[2]<<8) | buf[3];
- printk(KERN_DEBUG "H=>D: 0x%04x(%d)\n", hci_cmd, hci_len);
- #endif
+ netdev_dbg(dev, "H=>D: 0x%04x(%d)\n", hci_cmd, hci_len);
gdm_wimax_send(nic, msg, len);
}
@@ -312,11 +308,9 @@ static int gdm_wimax_event_send(struct net_device *dev, char *buf, int size)
struct evt_entry *e;
unsigned long flags;
- #if defined(DEBUG_HCI)
u16 hci_cmd = ((u8)buf[0]<<8) | (u8)buf[1];
u16 hci_len = ((u8)buf[2]<<8) | (u8)buf[3];
- printk(KERN_DEBUG "D=>H: 0x%04x(%d)\n", hci_cmd, hci_len);
- #endif
+ netdev_dbg(dev, "D=>H: 0x%04x(%d)\n", hci_cmd, hci_len);
spin_lock_irqsave(&wm_event.evt_lock, flags);
@@ -376,9 +370,7 @@ static int gdm_wimax_tx(struct sk_buff *skb, struct net_device *dev)
struct nic *nic = netdev_priv(dev);
struct fsm_s *fsm = (struct fsm_s *) nic->sdk_data[SIOC_DATA_FSM].buf;
- #if defined(DEBUG_SDU)
- dump_eth_packet("TX", skb->data, skb->len);
- #endif
+ dump_eth_packet(dev, "TX", skb->data, skb->len);
ret = gdm_wimax_header(&skb);
if (ret < 0) {
@@ -717,9 +709,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len)
struct sk_buff *skb;
int ret;
- #if defined(DEBUG_SDU)
- dump_eth_packet("RX", buf, len);
- #endif
+ dump_eth_packet(dev, "RX", buf, len);
skb = dev_alloc_skb(len + 2);
if (!skb) {