* [PATCH V2] staging: ks7010: use netdev_* instead of printk()
@ 2016-10-09 16:34 Sabitha George
2016-10-09 17:46 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Sabitha George @ 2016-10-09 16:34 UTC (permalink / raw)
To: gregkh, wsa+renesas, devel, linux-kernel; +Cc: Sabitha George
Fixes checkpatch warning on printk usage in ks_hostif.c
Signed-off-by: Sabitha George <sabitha.george@gmail.com>
---
drivers/staging/ks7010/ks_hostif.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 5714cf7..1d62033 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -465,8 +465,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
skb->dev->last_rx = jiffies;
netif_rx(skb);
} else {
- printk(KERN_WARNING
- "ks_wlan: Memory squeeze, dropping packet.\n");
+ netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
@@ -500,8 +499,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
skb->dev->last_rx = jiffies;
netif_rx(skb);
} else {
- printk(KERN_WARNING
- "ks_wlan: Memory squeeze, dropping packet.\n");
+ netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, dropping packet.\n");
priv->nstats.rx_dropped++;
}
break;
@@ -549,7 +547,8 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
dev->dev_addr[5] = priv->eth_addr[5];
dev->dev_addr[6] = 0x00;
dev->dev_addr[7] = 0x00;
- printk(KERN_INFO "ks_wlan: MAC ADDRESS = %pM\n", priv->eth_addr);
+ netdev_info(dev, "ks_wlan: MAC ADDRESS = %pM\n",
+ priv->eth_addr);
break;
case DOT11_PRODUCT_VERSION:
/* firmware version */
@@ -557,8 +556,8 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
priv->version_size = priv->rx_size;
memcpy(priv->firmware_version, priv->rxp, priv->rx_size);
priv->firmware_version[priv->rx_size] = '\0';
- printk(KERN_INFO "ks_wlan: firmware ver. = %s\n",
- priv->firmware_version);
+ netdev_info(dev, "ks_wlan: firmware ver. = %s\n",
+ priv->firmware_version);
hostif_sme_enqueue(priv, SME_GET_PRODUCT_VERSION);
/* wake_up_interruptible_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
@@ -578,12 +577,12 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
} else if (priv->eeprom_sum.type == 1) {
if (priv->eeprom_sum.result == 0) {
priv->eeprom_checksum = EEPROM_NG;
- printk("LOCAL_EEPROM_SUM NG\n");
+ netdev_info(dev, "LOCAL_EEPROM_SUM NG\n");
} else if (priv->eeprom_sum.result == 1) {
priv->eeprom_checksum = EEPROM_OK;
}
} else {
- printk("LOCAL_EEPROM_SUM error!\n");
+ netdev_err(dev, "LOCAL_EEPROM_SUM error!\n");
}
break;
default:
@@ -880,7 +879,7 @@ void hostif_stop_confirm(struct ks_wlan_private *priv)
netif_carrier_off(netdev);
tmp = FORCE_DISCONNECT & priv->connect_status;
priv->connect_status = tmp | DISCONNECT_STATUS;
- printk("IWEVENT: disconnect\n");
+ netdev_info(netdev, "IWEVENT: disconnect\n");
wrqu0.data.length = 0;
wrqu0.data.flags = 0;
@@ -890,7 +889,7 @@ void hostif_stop_confirm(struct ks_wlan_private *priv)
&& (old_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
eth_zero_addr(wrqu0.ap_addr.sa_data);
DPRINTK(3, "IWEVENT: disconnect\n");
- printk("IWEVENT: disconnect\n");
+ netdev_info(netdev, "IWEVENT: disconnect\n");
DPRINTK(3, "disconnect :: scan_ind_count=%d\n",
priv->scan_ind_count);
wireless_send_event(netdev, SIOCGIWAP, &wrqu0, NULL);
@@ -1096,7 +1095,7 @@ void hostif_event_check(struct ks_wlan_private *priv)
case HIF_AP_SET_CONF:
default:
//DPRINTK(1, "undefined event[%04X]\n", event);
- printk("undefined event[%04X]\n", event);
+ netdev_err(priv->net_dev, "undefined event[%04X]\n", event);
/* wake_up_all(&priv->confirm_wait); */
complete(&priv->confirm_wait);
break;
@@ -2644,7 +2643,7 @@ void hostif_sme_enqueue(struct ks_wlan_private *priv, unsigned short event)
} else {
/* in case of buffer overflow */
//DPRINTK(2,"sme queue buffer overflow\n");
- printk("sme queue buffer overflow\n");
+ netdev_err(priv->net_dev, "sme queue buffer overflow\n");
}
tasklet_schedule(&priv->sme_task);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH V2] staging: ks7010: use netdev_* instead of printk()
2016-10-09 16:34 [PATCH V2] staging: ks7010: use netdev_* instead of printk() Sabitha George
@ 2016-10-09 17:46 ` Joe Perches
2016-10-10 5:43 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2016-10-09 17:46 UTC (permalink / raw)
To: Sabitha George, gregkh, wsa+renesas, devel, linux-kernel
On Sun, 2016-10-09 at 22:04 +0530, Sabitha George wrote:
> Fixes checkpatch warning on printk usage in ks_hostif.c
[]
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
[]
> @@ -465,8 +465,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
> skb->dev->last_rx = jiffies;
> netif_rx(skb);
> } else {
> - printk(KERN_WARNING
> - "ks_wlan: Memory squeeze, dropping packet.\n");
> + netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, dropping packet.\n");
You could probably drop all the "ks_wlan: " prefixes here
and the rx_dropped increase generally removes the need
for a non-rate-limited warning message so these
memory squeeze messages could be removed as well.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V2] staging: ks7010: use netdev_* instead of printk()
2016-10-09 17:46 ` Joe Perches
@ 2016-10-10 5:43 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2016-10-10 5:43 UTC (permalink / raw)
To: Joe Perches; +Cc: Sabitha George, wsa+renesas, devel, linux-kernel
On Sun, Oct 09, 2016 at 10:46:26AM -0700, Joe Perches wrote:
> On Sun, 2016-10-09 at 22:04 +0530, Sabitha George wrote:
> > Fixes checkpatch warning on printk usage in ks_hostif.c
> []
> > diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> []
> > @@ -465,8 +465,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
> > skb->dev->last_rx = jiffies;
> > netif_rx(skb);
> > } else {
> > - printk(KERN_WARNING
> > - "ks_wlan: Memory squeeze, dropping packet.\n");
> > + netdev_warn(priv->net_dev, "ks_wlan: Memory squeeze, dropping packet.\n");
>
> You could probably drop all the "ks_wlan: " prefixes here
> and the rx_dropped increase generally removes the need
> for a non-rate-limited warning message so these
> memory squeeze messages could be removed as well.
I agree, ks_wlan: should be removed.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-10 5:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-09 16:34 [PATCH V2] staging: ks7010: use netdev_* instead of printk() Sabitha George
2016-10-09 17:46 ` Joe Perches
2016-10-10 5:43 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.