Skip to contentSkip to conversation

staging: rtl8192u: r8192U_wx: use netdev_warn() instead of printk()

PATCH Superseded Lourdes Pedrajas 2 participants 3 messages Mar 12, 2020 – Mar 13, 2020 Staging

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 staging: rtl8192u: r8192U_wx: use netdev_warn() instead of printk()

printk() is deprecated, use netdev_warn() instead, which is a message printing function specific for network devices defined in include/linux/netdevice.h. Issue found by checkpatch.

---
Changes since v4:
- Log message correction.

 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_wx.c +1 -1
index 0118edb0b9ab..100532598781 100644
@@ -588,7 +588,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
 				hwkey);                 /* KeyContent */
 
 		} else {
-			printk("wrong type in WEP, not WEP40 and WEP104\n");
+			netdev_warn(dev, "wrong type in WEP, not WEP40 and WEP104\n");
 		}
 
 	}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Lourdes Pedrajas

printk() is deprecated, use netdev_warn() instead, which is a message printing function specific for network devices defined in include/linux/netdevice.h.

I still don't think that "defined in include/linux/netdevice.h" is necessary. It's a well known function, and anyway if I don't know what it is, then grep or elixir is sufficient to find the definition.

julia

Quoted 33 lines

Issue found by checkpatch.

---
Changes since v4:
- Log message correction.

 drivers/staging/rtl8192u/r8192U_wx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192u/r8192U_wx.c +1 -2
index 0118edb0b9ab..100532598781 100644
@@ -588,7 +588,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
 				hwkey);                 /* KeyContent */
 
 		} else {
-			printk("wrong type in WEP, not WEP40 and WEP104\n");
+			netdev_warn(dev, "wrong type in WEP, not WEP40 and WEP104\n");
 		}
 
 	}
--

2.17.1

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200312210540.9381-1-lu%40pplo.net.

#2 lore raw
Quoted 4 lines · Julia Lawall

On Thu, 12 Mar 2020, Lourdes Pedrajas wrote:

Quoted 9 lines
Quoted 2 lines

printk() is deprecated, use netdev_warn() instead, which is a message printing function specific for network devices defined in include/linux/netdevice.h.

I still don't think that "defined in include/linux/netdevice.h" is necessary. It's a well known function, and anyway if I don't know what it is, then grep or elixir is sufficient to find the definition.

julia

Indeed, I am so sorry. Thank for your patience!

Lourdes