Staging: rtl8192u: ieee80211: Use netdev_info instead of printk
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
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, Pif (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
Quoted 8 lines · Georgiana Chelu
Replace printk with
netdev_infobecause structieee80211_devicecontains anet_devicestructure.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 ...Signed-off-by Georgiana Chelu <[email protected]>
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@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, Pif (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.
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu
Replace printk with
netdev_infobecause structieee80211_devicecontains anet_devicestructure.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 ...Signed-off-by Georgiana Chelu <[email protected]>
Quoted 7 lines
Acked-by Julia Lawall <[email protected]>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@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, Pif (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.
Quoted 34 lines · Georgiana Chelu
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu
Replace printk with
netdev_infobecause structieee80211_devicecontains anet_devicestructure.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 ...Signed-off-by Georgiana Chelu <[email protected]>Quoted 7 lines
Acked-by Julia Lawall <[email protected]>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 withnetdev_err(dev, ...),
but these debug messages are shown only whenCONFIG_IEEE80211_DEBUGis defined in the kernel configuration.2. Change the
IEEE80211_DEBUGmacro 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;
#defineIEEE80211_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,
GeorgianaQuoted 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@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, Pif (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.
Quoted 18 lines · Julia Lawall
Quoted 14 lines · Georgiana Chelu
Quoted 13 lines · Julia Lawall
Quoted 8 lines · Georgiana Chelu
Replace printk with
netdev_infobecause structieee80211_devicecontains anet_devicestructure.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 ...Signed-off-by Georgiana Chelu <[email protected]>
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Acked-by Julia Lawall <[email protected]>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 withnetdev_err(dev, ...),
but these debug messages are shown only whenCONFIG_IEEE80211_DEBUGis defined in the kernel configuration.2. Change the
IEEE80211_DEBUGmacro 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;
#defineIEEE80211_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 withKERN_DEBUGbefore. 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,
GeorgianaQuoted 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@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, Pif (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.
Greg KH
maintainerQuoted 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_infobecause structieee80211_devicecontains anet_devicestructure.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 ...Signed-off-by Georgiana Chelu <[email protected]>Acked-by Julia Lawall <[email protected]>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