Staging: speakup: Use pr_warn() defined in <linux/printk.h>.
PATCH 1/1 Staging: speakup: Use pr_warn() defined in <linux/printk.h>.
Dropping a user-defined pr_warn() and using the kernel message printing functions implemented in <linux/printk.h>.
Since both have the same functionality, using the standard kernel functions is better.
--- drivers/staging/speakup/spk_priv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/speakup/spk_priv.h +2 -4
@@ -11,13 +11,11 @@#ifndef _SPEAKUP_PRIVATE_H#define _SPEAKUP_PRIVATE_H +#include <linux/printk.h> +#include "spk_types.h" #include "spk_priv_keyinfo.h" -#ifndef pr_warn -#define pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg) -#endif -#define V_LAST_VAR { MAXVARS }#define SPACE 0x20#define SYNTH_CHECK 20030716/* today's date ought to do for check value */
---
2.20.1
Sam Muhammed, le dim. 22 mars 2020 10:33:22 -0400, a ecrit:
Quoted 7 lines
Dropping a user-defined
pr_warn()and using the kernel message printing functions implemented in <linux/printk.h>.Since both have the same functionality, using the standard kernel functions is better.
Signed-off-by Sam Muhammed <[email protected]>
Thanks!
Quoted 27 lines
--- drivers/staging/speakup/spk_priv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/staging/speakup/spk_priv.h +2
-5@@ -11,13 +11,11 @@#ifndef _SPEAKUP_PRIVATE_H#define _SPEAKUP_PRIVATE_H +#include <linux/printk.h> +#include "spk_types.h" #include "spk_priv_keyinfo.h" -#ifndef pr_warn -#define pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg) -#endif -#define V_LAST_VAR { MAXVARS }#define SPACE 0x20#define SYNTH_CHECK 20030716/* today's date ought to do for check value */ ---2.20.1
Quoted 11 lines · Samuel Thibault
Sam Muhammed, le dim. 22 mars 2020 10:33:22 -0400, a ecrit:
Quoted 7 lines
Dropping a user-defined
pr_warn()and using the kernel message printing functions implemented in <linux/printk.h>.Since both have the same functionality, using the standard kernel functions is better.
Signed-off-by Sam Muhammed <[email protected]>Reviewed-by Samuel Thibault <[email protected]>
Thank you!
I have a question though, some drivers define pr_fmt() to include the driver's KBUILD_MODNAME
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
I added it, it builds fine but prompts me about a warning that its redefined over the original pr_fmt() in <linux/printk.h>
is this warning usually ignored? because there are lots of drivers redefined their own pr_fmt()
if so should i add it?
Sam
Quoted 30 lines
Thanks!
Quoted 27 lines
--- drivers/staging/speakup/spk_priv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/staging/speakup/spk_priv.h +2
-5@@ -11,13 +11,11 @@#ifndef _SPEAKUP_PRIVATE_H#define _SPEAKUP_PRIVATE_H +#include <linux/printk.h> +#include "spk_types.h" #include "spk_priv_keyinfo.h" -#ifndef pr_warn -#define pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg) -#endif -#define V_LAST_VAR { MAXVARS }#define SPACE 0x20#define SYNTH_CHECK 20030716/* today's date ought to do for check value */ ---2.20.1
Quoted 19 lines · Sam Muhammed
Quoted 11 lines · Samuel Thibault
Sam Muhammed, le dim. 22 mars 2020 10:33:22 -0400, a ecrit:
Quoted 7 lines
Dropping a user-defined
pr_warn()and using the kernel message printing functions implemented in <linux/printk.h>.Since both have the same functionality, using the standard kernel functions is better.
Signed-off-by Sam Muhammed <[email protected]>Reviewed-by Samuel Thibault <[email protected]>Thank you!
I have a question though, some drivers definepr_fmt()to include the driver'sKBUILD_MODNAME#define
pr_fmt(fmt)KBUILD_MODNAME": " fmt
Quoted 7 lines
I added it, it builds fine but prompts me about a warning that its redefined over the original
pr_fmt()in <linux/printk.h>is this warning usually ignored? because there are lots of drivers redefined their own
pr_fmt()if so should i add it?
I don't know the details of this issue, but you shouldn't add warnings. If you do make make path/file.i you will see the result of preprocessing the file. Then maybe you can see why there is a warning in your case, but not in the other cases.
julia
Quoted 40 lines
Sam
Quoted 19 lines
Thanks!
Quoted 17 lines
--- drivers/staging/speakup/spk_priv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/staging/speakup/spk_priv.h +2
-0@@ -11,13 +11,11 @@#ifndef _SPEAKUP_PRIVATE_H#define _SPEAKUP_PRIVATE_H +#include <linux/printk.h> +#include "spk_types.h" #include "spk_priv_keyinfo.h" Quoted 11 lines
Quoted 10 lines
drivers/staging/speakup/spk_priv.h +0
-5-#ifndef pr_warn -#define pr_warn(fmt, arg...) printk(KERN_WARNING fmt, ##arg) -#endif -#define V_LAST_VAR { MAXVARS }#define SPACE 0x20#define SYNTH_CHECK 20030716/* today's date ought to do for check value */ ---2.20.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/35ae3f18d6f774d19119d0fed29773f14f99da94.camel%40gmail.com.