Skip to contentSkip to conversation

Staging: rtl8192u: ieee80211: Use netdev_info instead of printk

PATCH In review Georgiana Chelu 3 participants 6 messages Sep 19, 2017 – Sep 29, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8192u: ieee80211: Use netdev_info instead of printk

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +2 -2
index 8aa38dcf0dfd..0f86195680e8 100644
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
 
 	if (ACT_ADDBARSP == type) {
 		// Status Code
-		printk(KERN_INFO "=====>to send ADDBARSP\n");
+		netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
 		put_unaligned_le16(StatusCode, tag);
 		tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
 	pBaTimeoutVal = (u16 *)(tag + 5);
 	pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-	printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst);
+	netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
 	if ((ieee->current_network.qos_data.active == 0) ||
 		(!ieee->pHTInfo->bCurrentHTSupport)) //||
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Georgiana Chelu

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Maybe all the locally defined debug levels are not really needed, and the calls to the debug macros could also be replaced by appropriate calls to netdev logging functions.

julia

Quoted 36 lines
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +2 -3
index 8aa38dcf0dfd..0f86195680e8 100644
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
 
 	if (ACT_ADDBARSP == type) {
 		// Status Code
-		printk(KERN_INFO "=====>to send ADDBARSP\n");
+		netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
 		put_unaligned_le16(StatusCode, tag);
 		tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
 	pBaTimeoutVal = (u16 *)(tag + 5);
 	pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-	printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst);
+	netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
 	if ((ieee->current_network.qos_data.active == 0) ||
 		(!ieee->pHTInfo->bCurrentHTSupport)) //||
--

2.11.0

--
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/20170919195406.n6kztu5q3pnduhir%40fireworks.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Quoted 7 lines

Maybe all the locally defined debug levels are not really needed, and the calls to the debug macros could also be replaced by appropriate calls to netdev logging functions.

julia

I think there are two options:

1. Replace IEEE80211_DEBUG(IEEE80211_DL_ERR, ...) occurrences with netdev_err(dev, ...),
but these debug messages are shown only when CONFIG_IEEE80211_DEBUG is defined in the kernel configuration.

2. Change the IEEE80211_DEBUG macro to use netdev_* instead of printk. But, that would require extra checking in order to use the correct netdev_* macro.

extern u32 ieee80211_debug_level;
#define IEEE80211_DEBUG(level, fmt, args...) \

do { if (ieee80211_debug_level & (level)) \
         printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)

So, what is your opinion?

Thank you,
Georgiana

Quoted 37 lines
Quoted 37 lines
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +2 -3
index 8aa38dcf0dfd..0f86195680e8 100644
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
 
      if (ACT_ADDBARSP == type) {
              // Status Code
-             printk(KERN_INFO "=====>to send ADDBARSP\n");
+             netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
              put_unaligned_le16(StatusCode, tag);
              tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
      pBaTimeoutVal = (u16 *)(tag + 5);
      pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-     printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst);
+     netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
      if ((ieee->current_network.qos_data.active == 0) ||
              (!ieee->pHTInfo->bCurrentHTSupport)) //||
--

2.11.0

--
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/20170919195406.n6kztu5q3pnduhir%40fireworks.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 34 lines · Georgiana Chelu
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Quoted 7 lines

Maybe all the locally defined debug levels are not really needed, and the calls to the debug macros could also be replaced by appropriate calls to netdev logging functions.

julia

I think there are two options:

1. Replace IEEE80211_DEBUG(IEEE80211_DL_ERR, ...) occurrences with netdev_err(dev, ...),
but these debug messages are shown only when CONFIG_IEEE80211_DEBUG is defined in the kernel configuration.

2. Change the IEEE80211_DEBUG macro to use netdev_* instead of printk. But, that would require extra checking in order to use the correct netdev_* macro.

Quoted 7 lines

extern u32 ieee80211_debug_level;
#define IEEE80211_DEBUG(level, fmt, args...) \

do { if (ieee80211_debug_level & (level)) \
         printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)

So, what is your opinion?

One option would be to drop the whole mess and put everything at _debug, because everything was ultimately done with KERN_DEBUG before. Unfortunately this code doesn't seem to have a specific maintainer who might know whether all the debugging messages are still useful. Perhaps Greg would have an opinion.

julia

Quoted 49 lines

Thank you,
Georgiana

Quoted 30 lines
Quoted 30 lines
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +2 -3
index 8aa38dcf0dfd..0f86195680e8 100644
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
 
      if (ACT_ADDBARSP == type) {
              // Status Code
-             printk(KERN_INFO "=====>to send ADDBARSP\n");
+             netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
              put_unaligned_le16(StatusCode, tag);
              tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
      pBaTimeoutVal = (u16 *)(tag + 5);
      pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-     printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst);
+     netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
      if ((ieee->current_network.qos_data.active == 0) ||
              (!ieee->pHTInfo->bCurrentHTSupport)) //||
--

2.11.0

Quoted 7 lines
Quoted 7 lines

--
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/20170919195406.n6kztu5q3pnduhir%40fireworks.
For more options, visit https://groups.google.com/d/optout.

--
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/CALta04zspRuf0a2ELBCYZOXK%3DK4UDkPTeEDJN%3DsUBYuZEzJbXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 18 lines · Julia Lawall
Quoted 14 lines · Georgiana Chelu
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Maybe all the locally defined debug levels are not really needed, and the calls to the debug macros could also be replaced by appropriate calls to netdev logging functions.

julia

Hi Greg,

Are debug levels still needed? As Julia pointed out, all IEEE80211_DEBUG_* macros use printk(KERN_*) in the end. Do you think it is useful and safe to replace these macros with netdev_*?

Thank you,
Georgiana

Quoted 78 lines
Quoted 13 lines

I think there are two options:

1. Replace IEEE80211_DEBUG(IEEE80211_DL_ERR, ...) occurrences with netdev_err(dev, ...),
but these debug messages are shown only when CONFIG_IEEE80211_DEBUG is defined in the kernel configuration.

2. Change the IEEE80211_DEBUG macro to use netdev_* instead of printk. But, that would require extra checking in order to use the correct netdev_* macro.

Quoted 7 lines

extern u32 ieee80211_debug_level;
#define IEEE80211_DEBUG(level, fmt, args...) \

do { if (ieee80211_debug_level & (level)) \
         printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)

So, what is your opinion?

One option would be to drop the whole mess and put everything at _debug, because everything was ultimately done with KERN_DEBUG before. Unfortunately this code doesn't seem to have a specific maintainer who might know whether all the debugging messages are still useful. Perhaps Greg would have an opinion.

julia

Quoted 49 lines

Thank you,
Georgiana

Quoted 30 lines
Quoted 30 lines
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +2 -3
index 8aa38dcf0dfd..0f86195680e8 100644
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P
 
      if (ACT_ADDBARSP == type) {
              // Status Code
-             printk(KERN_INFO "=====>to send ADDBARSP\n");
+             netdev_info(ieee->dev, "=====>to send ADDBARSP\n");
 
              put_unaligned_le16(StatusCode, tag);
              tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
      pBaTimeoutVal = (u16 *)(tag + 5);
      pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-     printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst);
+     netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
      if ((ieee->current_network.qos_data.active == 0) ||
              (!ieee->pHTInfo->bCurrentHTSupport)) //||
--

2.11.0

Quoted 7 lines
Quoted 7 lines

--
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/20170919195406.n6kztu5q3pnduhir%40fireworks.
For more options, visit https://groups.google.com/d/optout.

--
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/CALta04zspRuf0a2ELBCYZOXK%3DK4UDkPTeEDJN%3DsUBYuZEzJbXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

maintainer
#5 lore raw
Quoted 25 lines · Georgiana Chelu
Quoted 24 lines · Julia Lawall
Quoted 20 lines · Georgiana Chelu
Quoted 19 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu

Replace printk with netdev_info because struct ieee80211_device contains a net_device structure.

Issue found by checkpatch.pl script.
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...

Maybe all the locally defined debug levels are not really needed, and the calls to the debug macros could also be replaced by appropriate calls to netdev logging functions.

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

julia

Hi Greg,

Are debug levels still needed? As Julia pointed out, all IEEE80211_DEBUG_* macros use printk(KERN_*) in the end. Do you think it is useful and safe to replace these macros with netdev_*?

I really do not know, sorry.

greg k-h