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>
This commit is contained in:
Haneen Mohammed 2015-03-06 21:59:04 +03:00 committed by Greg Kroah-Hartman
parent 14f63eeecf
commit aed1c72e44
11 changed files with 30 additions and 28 deletions

View 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);

View 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;
}

View 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;
}
}

View 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;
}

View 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;
}
}

View 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;
}
}

View 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;
}

View 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;
}
}

View 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;
}
}

View 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;
}

View 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;