Staging: fbtft: clean dev_err() logging
This patch removes __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:
@a@
expression E, R;
expression msg;
@@
dev_err(E, msg, __func__, R);
@script:python b@
e << a.msg;
y;
@@
if(e.find("%s: ") == True):
m = e.replace("%s: ", "", 1);
coccinelle.y = m;
elif(e.find("%s ") == True):
m = e.replace("%s ", "", 1);
coccinelle.y = m;
elif(e.find("%s:") == True):
m = e.replace("%s:", "", 1);
coccinelle.y = m;
else:
m = e.replace("%s", "",1);
coccinelle.y = m;
@c@
expression a.E, a.msg, a.R;
identifier b.y;
@@
- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index 9b2f8cf..e19b814 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -59,8 +59,7 @@
}
if ((len % 8) != 0) {
dev_err(par->info->device,
- "%s: error: len=%zu must be divisible by 8\n",
- __func__, len);
+ "error: len=%zu must be divisible by 8\n", len);
return -EINVAL;
}
@@ -106,8 +105,8 @@
if (par->startbyte) {
if (len > 32) {
dev_err(par->info->device,
- "%s: len=%zu can't be larger than 32 when using 'startbyte'\n",
- __func__, len);
+ "len=%zu can't be larger than 32 when using 'startbyte'\n",
+ len);
return -EINVAL;
}
txbuf[0] = par->startbyte | 0x3;