Skip to contentSkip to conversation

Staging: ks7010: replace printk() with pr*format

PATCH In review Mihaela Muraru 2 participants 2 messages Oct 6, 2016 – Oct 7, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: ks7010: replace printk() with pr*format

This patch replaces printk() with pr_warn and pr_info macros.

By doing this it is reduce to silence checkpatch.pl WARNING:
Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/staging/ks7010/ks_hostif.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/staging/ks7010/ks_hostif.c +5 -8
index c57ca58..1241f67 100644
@@ -476,8 +476,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");
+			pr_warn("ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
@@ -511,8 +510,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");
+			pr_warn("ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
@@ -560,8 +558,7 @@ 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 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+		pr_info("ks_wlan: MAC ADDRESS = %02x:%02x:%02x:%02x:%02x:%02x\n",
 		       priv->eth_addr[0], priv->eth_addr[1], priv->eth_addr[2],
 		       priv->eth_addr[3], priv->eth_addr[4], priv->eth_addr[5]);
 		break;
@@ -571,8 +568,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);
+		pr_info("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);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Mihaela Muraru

This patch replaces printk() with pr_warn and pr_info macros.

By doing this it is reduce to silence checkpatch.pl WARNING:
Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

It looks like you should be able to use the netdev functions somehow.

julia

Quoted 61 lines
---
 drivers/staging/ks7010/ks_hostif.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/staging/ks7010/ks_hostif.c +5 -9
index c57ca58..1241f67 100644
@@ -476,8 +476,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");
+			pr_warn("ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
@@ -511,8 +510,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");
+			pr_warn("ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
@@ -560,8 +558,7 @@ 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 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+		pr_info("ks_wlan: MAC ADDRESS = %02x:%02x:%02x:%02x:%02x:%02x\n",
 		       priv->eth_addr[0], priv->eth_addr[1], priv->eth_addr[2],
 		       priv->eth_addr[3], priv->eth_addr[4], priv->eth_addr[5]);
 		break;
@@ -571,8 +568,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);
+		pr_info("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);
--

2.7.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20161006223651.GA8132%40domino-MS-16Y1.
For more options, visit https://groups.google.com/d/optout.