staging: wilc1000: Include KERN_ facility level for printk()
PATCH 1/1 staging: wilc1000: Include KERN_ facility level for printk()
This patch includes KERN_ facility level for printk(). KERN_INFO is justified here as the messages here are informational.
--- drivers/staging/wilc1000/wilc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_debugfs.c +2 -2
@@ -69,9 +69,9 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,atomic_set (&WILC_DEBUG_LEVEL , (int )flag);if (flag ==0 ) -printk ("Debug-level disabled\n" ); +printk (KERN_INFO "Debug-level disabled\n" );else -printk ("Debug-level enabled\n" ); +printk (KERN_INFO "Debug-level enabled\n" );return count; }
Signature · 1 line
2.5.0
Quoted 13 lines · Janani Ravichandran
This patch includes
KERN_facility level forprintk().KERN_INFOis justified here as the messages here are informational.Signed-off-by Janani Ravichandran <[email protected]>--- drivers/staging/wilc1000/wilc_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/wilc1000/wilc_debugfs.c +0
-0
drivers/staging/wilc1000/wilc_debugfs.c static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf, · line 74
Quoted 8 lines
drivers/staging/wilc1000/wilc_debugfs.c +2
-2@@ -69,9 +69,9 @@ static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,atomic_set (&WILC_DEBUG_LEVEL , (int )flag);if (flag ==0 ) -printk ("Debug-level disabled\n" ); +printk (KERN_INFO "Debug-level disabled\n" );else -printk ("Debug-level enabled\n" ); +printk (KERN_INFO "Debug-level enabled\n" );
You shouldn't add new uses of printk. I would think checpatch would have complained about this. I don't know what kind of driver this is, but check whether pr_info, dev_info, or netdev_info would be appropriate. If neither of the last to can be used, pr_info is certainly possible.
julia
Quoted 13 lines
drivers/staging/wilc1000/wilc_debugfs.c +0
-0return count; }Signature · 8 lines
2.5.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/20160214041910.GA25485%40janani-Inspiron-3521. For more options, visit https://groups.google.com/d/optout.
Quoted 6 lines
else
drivers/staging/wilc1000/wilc_debugfs.c static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf, · line 74
Quoted 2 lines
drivers/staging/wilc1000/wilc_debugfs.c +1
-1-printk ("Debug-level enabled\n" ); +printk (KERN_INFO "Debug-level enabled\n" );You shouldn't add new uses of printk. I would think checpatch would have complained about this.
Hi Julia, I made this change as there was a checkpatch warning about KERN_ facility level
not being there in the printk() statements.
Quoted 2 lines
I don't know what kind of driver this is, but
check whetherpr_info,dev_info, ornetdev_infowould be appropriate.
This is a wireless device by Atmel. So I guess, netdev_info fits better. Do I make that change instead? Let me know :)
Janani.
Quoted 23 lines
If
neither of the last to can be used,pr_infois certainly possible.julia
Quoted 8 lines
return count;}
--
2.5.0--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
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/20160214041910.GA25485%40janani-Inspiron-3521
.Quoted 2 lines
For more options, visit https://groups.google.com/d/optout.
Quoted 19 lines · Janani Ravichandran
> else
> - printk("Debug-level enabled\n"); > + printk(KERN_INFO "Debug-level enabled\n");You shouldn't add new uses of printk. I would think checpatch would have
complained about this.Hi Julia, I made this change as there was a checkpatch warning about
KERN_facility level
not being there in theprintk()statements.
I don't know what kind of driver this is, but
check whetherpr_info,dev_info, ornetdev_infowould be appropriate.
Quoted 2 lines
This is a wireless device by Atmel. So I guess,
netdev_infofits better. Do I make that change instead? Let me know :)
Yes, I think it would be better to go to the right thing all at once. Your previous fix would just convert one checkpatch error into another.
julia
Quoted 30 lines
Janani.
If neither of the last to can be used, pr_info is certainly possible. julia > > return count; > } > -- > 2.5.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 visithttps://groups.google.com/d/msgid/outreachy-kernel/20160214041910.GA25485%4 0janani-Inspiron-3521. > For more options, visit https://groups.google.com/d/optout. >
Greg KH
maintainerQuoted 15 lines · Janani Ravichandran
Quoted 6 lines
� � � �else
-� � � � � � �printk("Debug-level enabled\n"); +� � � � � � �printk(KERN_INFO "Debug-level enabled\n");You shouldn't add new uses of printk.� I would think checpatch would have complained about this.�
Hi Julia, I made this change as there was a checkpatch warning about
KERN_facility level
not being there in theprintk()statements.
�
Quoted 5 lines
I don't know what kind of driver this is, but
check whetherpr_info,dev_info, ornetdev_infowould be appropriate.This is a wireless device by Atmel. So I guess,
netdev_infofits better. Do I make that change instead? Let me know :)
For this specific file and location, you are correct in using KERN_INFO, but, the larger problem is that the driver shouldn't have this function at all. People are working on removing all of the "custom debugging" logic in it, and when done, this function will be removed.
So I'll take this patch as-is, but you might want to work on removing that logic if you are looking for something to do. But note this is a very fast-moving driver right now, I get about 100 patches a week for it, so it might be tough to keep in sync with what is happening.
thanks,
greg k-h