Staging: media: Cleanup dmesg output
Subsystems (2)
PATCH 1/1 Staging: media: Cleanup dmesg output
This patch does cleanup of dmesg output by removing printing of function name because printing device name is sufficient. This makes the function dev_err more compact and readable. Thus the __func__ argument can be dropped.
Done using coccinelle:
@r1@
expression e,x;
expression g;
@@dev_err(e,g,__func__,x)
@script:python b@
g2 <<r1.g;
y;
@@
if(g2.find("%s:")==True):
coccinelle.y=g2[5:]
elif(g2.find("%s")==True):
coccinelle.y=g2[4:]coccinelle.y='"'+coccinelle.y
@c@
expression r1.g;
identifier b.y;
expression r1.e,r1.x;
@@
- dev_err(e,g,__func__,x)
+ dev_err(e,y,x)
--- drivers/staging/media/lirc/lirc_sasem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/lirc/lirc_sasem.c +1 -2
@@ -181,8 +181,7 @@ static void deregister_from_lirc(struct sasem_context *context) retval =lirc_unregister_driver (minor);if (retval)dev_err (&context->dev->dev, -"%s: unable to deregister from lirc (%d)\n" , - __func__, retval); +"unable to deregister from lirc (%d)\n" , retval);else dev_info (&context->dev->dev,"Deregistered Sasem driver (minor:%d)\n" , minor);
Signature · 1 line
1.9.1
Quoted 2 lines · Bhumika Goyal
This patch does cleanup of dmesg output by removing printing of function name because printing device name is sufficient.
It seems a little bit arbitrary to say that it is sufficient. Why is it sufficient?
Quoted 2 lines
This makes the function
dev_errmore compact and readable.
Actually, it doesn't do anything to the function. It may do something to the call to the function.
Quoted 2 lines
Thus the
__func__argument can be
dropped.
It looks like the "thus" follows from the sentence just before, about compact and readable. But making something compact and readable doesn't make it possible to do the thing.
julia
Quoted 55 lines
Done using coccinelle:
@r1@
expression e,x;
expression g;
@@dev_err(e,g,__func__,x)@script:python b@
g2 <<r1.g;
y;
@@
if(g2.find("%s:")==True):coccinelle.y=g2[5:] elif(g2.find("%s")==True): coccinelle.y=g2[4:]coccinelle.y='"'+coccinelle.y
@c@
expression r1.g;
identifier b.y;
expression r1.e,r1.x;
@@
-dev_err(e,g,__func__,x)
+dev_err(e,y,x)Signed-off-by Bhumika Goyal <[email protected]>--- drivers/staging/media/lirc/lirc_sasem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/staging/media/lirc/lirc_sasem.c +1
-2@@ -181,8 +181,7 @@ static void deregister_from_lirc(struct sasem_context *context) retval =lirc_unregister_driver (minor);if (retval)dev_err (&context->dev->dev, -"%s: unable to deregister from lirc (%d)\n" , - __func__, retval); +"unable to deregister from lirc (%d)\n" , retval);else dev_info (&context->dev->dev,"Deregistered Sasem driver (minor:%d)\n" , minor);Signature · 8 lines
1.9.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 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/1456639780-8087-1-git-send-email-bhumirks%40gmail.com. For more options, visit https://groups.google.com/d/optout.