From: Haneen Mohammed Date: Fri, 6 Mar 2015 18:59:04 +0000 (+0300) Subject: Staging: fbtft: clean dev_err() logging X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=aed1c72e447f0ac0985eecbe1c2403eb7176d606;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 9cc7d25cf0e5..7aa9e8c0763d 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -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); diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 5e08a70c25b4..b13162c35508 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -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; } diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c index 8df97373e183..e21af6c5a95f 100644 --- a/drivers/staging/fbtft/fb_ra8875.c +++ b/drivers/staging/fbtft/fb_ra8875.c @@ -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; } } diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c index 5ea195b0de1b..15ee44dd130b 100644 --- a/drivers/staging/fbtft/fb_ssd1306.c +++ b/drivers/staging/fbtft/fb_ssd1306.c @@ -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; } diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c index ba17f0c83ec5..5bb741046c85 100644 --- a/drivers/staging/fbtft/fb_ssd1331.c +++ b/drivers/staging/fbtft/fb_ssd1331.c @@ -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; } } diff --git a/drivers/staging/fbtft/fb_tls8204.c b/drivers/staging/fbtft/fb_tls8204.c index 8738c7a7bfda..fcd38bf2ed79 100644 --- a/drivers/staging/fbtft/fb_tls8204.c +++ b/drivers/staging/fbtft/fb_tls8204.c @@ -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; } } diff --git a/drivers/staging/fbtft/fb_uc1701.c b/drivers/staging/fbtft/fb_uc1701.c index d70ac524278c..26d669b57916 100644 --- a/drivers/staging/fbtft/fb_uc1701.c +++ b/drivers/staging/fbtft/fb_uc1701.c @@ -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; } diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c index 975b579359f3..88fb2c0132d5 100644 --- a/drivers/staging/fbtft/fb_watterott.c +++ b/drivers/staging/fbtft/fb_watterott.c @@ -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; } } diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index b3cddb0b3d69..52af9cbbc2a6 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -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; } } diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 3c4769aab678..fd9f92e2dba6 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -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; } diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c index 9b2f8cfbb386..e19b814c3327 100644 --- a/drivers/staging/fbtft/fbtft-io.c +++ b/drivers/staging/fbtft/fbtft-io.c @@ -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;