Staging: fbtft: clean dev_err() logging
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 6 Mar 2015 18:59:04 +0000 (21:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Mar 2015 23:55:36 +0000 (15:55 -0800)
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>
drivers/staging/fbtft/fb_agm1264k-fl.c
drivers/staging/fbtft/fb_pcd8544.c
drivers/staging/fbtft/fb_ra8875.c
drivers/staging/fbtft/fb_ssd1306.c
drivers/staging/fbtft/fb_ssd1331.c
drivers/staging/fbtft/fb_tls8204.c
drivers/staging/fbtft/fb_uc1701.c
drivers/staging/fbtft/fb_watterott.c
drivers/staging/fbtft/fbtft-bus.c
drivers/staging/fbtft/fbtft-core.c
drivers/staging/fbtft/fbtft-io.c

index 9cc7d25cf0e5cbfd3e188c62e92d9893b2f79980..7aa9e8c0763d5f52fbe830beab8a42e676f5cf3f 100644 (file)
@@ -198,8 +198,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
 
        if (*buf > 1) {
                va_end(args);
-               dev_err(par->info->device, "%s: Incorrect chip sellect request (%d)\n",
-                       __func__, *buf);
+               dev_err(par->info->device,
+                       "Incorrect chip sellect request (%d)\n", *buf);
                return;
        }
 
@@ -224,8 +224,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
                ret = par->fbtftops.write(par, par->buf, len * (sizeof(u8)));
                if (ret < 0) {
                        va_end(args);
-                       dev_err(par->info->device, "%s: write() failed and returned %d\n",
-                               __func__, ret);
+                       dev_err(par->info->device,
+                               "write() failed and returned %d\n", ret);
                        return;
                }
        }
@@ -376,8 +376,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
                        ret = par->fbtftops.write(par, buf, len);
                        if (ret < 0)
                                dev_err(par->info->device,
-                                       "%s: write failed and returned: %d\n",
-                                       __func__, ret);
+                                       "write failed and returned: %d\n",
+                                       ret);
                }
                /* right half of display */
                if (addr_win.xe >= par->info->var.xres / 2) {
@@ -398,8 +398,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
                        par->fbtftops.write(par, buf, len);
                        if (ret < 0)
                                dev_err(par->info->device,
-                                       "%s: write failed and returned: %d\n",
-                                       __func__, ret);
+                                       "write failed and returned: %d\n",
+                                       ret);
                }
        }
        kfree(convert_buf);
index 5e08a70c25b4d54e84402d3af7648c59c1386bae..b13162c3550819c98726b4a748663ab5f03eca23 100644 (file)
@@ -130,7 +130,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
        gpio_set_value(par->gpio.dc, 1);
        ret = par->fbtftops.write(par, par->txbuf.buf, 6*84);
        if (ret < 0)
-               dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
+               dev_err(par->info->device, "write failed and returned: %d\n",
+                       ret);
 
        return ret;
 }
index 8df97373e183d533920e7c07af2005fdac984696..e21af6c5a95fa3760dace0c7c74a98d307fb0ab4 100644 (file)
@@ -238,8 +238,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
        ret = par->fbtftops.write(par, par->buf, 2);
        if (ret < 0) {
                va_end(args);
-               dev_err(par->info->device, "%s: write() failed and returned %dn",
-                       __func__, ret);
+               dev_err(par->info->device, "write() failed and returned %dn",
+                       ret);
                return;
        }
        len--;
@@ -256,8 +256,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
                ret = par->fbtftops.write(par, par->buf, len + 1);
                if (ret < 0) {
                        va_end(args);
-                       dev_err(par->info->device, "%s: write() failed and returned %dn",
-                               __func__, ret);
+                       dev_err(par->info->device,
+                               "write() failed and returned %dn", ret);
                        return;
                }
        }
index 5ea195b0de1b3de8ec39e0ef71ad73d92b6ca7ca..15ee44dd130bddfd282849631964b2cf23ea2d3c 100644 (file)
@@ -193,8 +193,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
        ret = par->fbtftops.write(par, par->txbuf.buf,
                                par->info->var.xres*par->info->var.yres/8);
        if (ret < 0)
-               dev_err(par->info->device,
-                       "%s: write failed and returned: %d\n", __func__, ret);
+               dev_err(par->info->device, "write failed and returned: %d\n",
+                       ret);
 
        return ret;
 }
index ba17f0c83ec50589d59dfa138b58ead186652355..5bb741046c85264104c4160f17d2b2be3d3d31e5 100644 (file)
@@ -83,7 +83,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
        ret = par->fbtftops.write(par, par->buf, sizeof(u8));
        if (ret < 0) {
                va_end(args);
-               dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret);
+               dev_err(par->info->device,
+                       "write() failed and returned %d\n", ret);
                return;
        }
        len--;
@@ -95,7 +96,8 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
                ret = par->fbtftops.write(par, par->buf, len * (sizeof(u8)));
                if (ret < 0) {
                        va_end(args);
-                       dev_err(par->info->device, "%s: write() failed and returned %d\n", __func__, ret);
+                       dev_err(par->info->device,
+                               "write() failed and returned %d\n", ret);
                        return;
                }
        }
index 8738c7a7bfda31119d0275e4f74e3f151d1b7598..fcd38bf2ed79f9f66f37a1fa2811ebfb89c4586e 100644 (file)
@@ -127,7 +127,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
                ret = par->fbtftops.write(par, par->txbuf.buf, WIDTH);
                if (ret < 0) {
                        dev_err(par->info->device,
-                               "%s: write failed and returned: %d\n", __func__, ret);
+                               "write failed and returned: %d\n", ret);
                        break;
                }
        }
index d70ac524278c79d88732cc2349ba5e14304309d8..26d669b57916c659c09c88f8cd1ac6fc0381f02c 100644 (file)
@@ -183,7 +183,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
        }
 
        if (ret < 0)
-               dev_err(par->info->device, "%s: write failed and returned: %d\n", __func__, ret);
+               dev_err(par->info->device, "write failed and returned: %d\n",
+                       ret);
 
        return ret;
 }
index 975b579359f367af94c10b7976ccb3dcfba5796c..88fb2c0132d5257542c9e75964c47f164c5e36f5 100644 (file)
@@ -65,7 +65,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
        ret = par->fbtftops.write(par, par->buf, len);
        if (ret < 0) {
                dev_err(par->info->device,
-                       "%s: write() failed and returned %d\n", __func__, ret);
+                       "write() failed and returned %d\n", ret);
                return;
        }
 }
index b3cddb0b3d698a9d606ece34e49288348f9e769b..52af9cbbc2a688c8bb8d18e918ba1469821928c9 100644 (file)
@@ -111,7 +111,7 @@ void fbtft_write_reg8_bus9(struct fbtft_par *par, int len, ...)
        ret = par->fbtftops.write(par, par->buf, (len + pad) * sizeof(u16));
        if (ret < 0) {
                dev_err(par->info->device,
-                       "%s: write() failed and returned %d\n", __func__, ret);
+                       "write() failed and returned %d\n", ret);
                return;
        }
 }
index 3c4769aab6781a1d218ba1748fc379b70172bbb8..fd9f92e2dba65047d79d34877433c56f885f5e0b 100644 (file)
@@ -703,9 +703,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
 
        /* sanity check */
        if (display->gamma_num * display->gamma_len > FBTFT_GAMMA_MAX_VALUES_TOTAL) {
-               dev_err(dev,
-                       "%s: FBTFT_GAMMA_MAX_VALUES_TOTAL=%d is exceeded\n",
-                       __func__, FBTFT_GAMMA_MAX_VALUES_TOTAL);
+               dev_err(dev, "FBTFT_GAMMA_MAX_VALUES_TOTAL=%d is exceeded\n",
+                       FBTFT_GAMMA_MAX_VALUES_TOTAL);
                return NULL;
        }
 
index 9b2f8cfbb38683f71cfc5e3c2ddbd965366476a4..e19b814c33273a567889d8d72cbd31d846c05938 100644 (file)
@@ -59,8 +59,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len)
        }
        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 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len)
        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;