From 62af7214d8c3c9c81788e988cf99bfb02da77d0b Mon Sep 17 00:00:00 2001 From: Haneen Mohammed Date: Fri, 6 Mar 2015 22:07:13 +0300 Subject: [PATCH] Staging: ste_rmi4: 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 --- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index f92ae1d..6385b33 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c @@ -209,7 +209,7 @@ static int synaptics_rmi4_set_page(struct synaptics_rmi4_data *pdata, txbuf[1] = page; retval = i2c_master_send(i2c, txbuf, PAGE_LEN); if (retval != PAGE_LEN) - dev_err(&i2c->dev, "%s:failed:%d\n", __func__, retval); + dev_err(&i2c->dev, "failed:%d\n", retval); else pdata->current_page = page; } else @@ -283,7 +283,7 @@ static int synaptics_rmi4_i2c_byte_write(struct synaptics_rmi4_data *pdata, retval = i2c_master_send(pdata->i2c_client, txbuf, 2); /* Add in retry on writes only in certain error return values */ if (retval != 2) { - dev_err(&i2c->dev, "%s:failed:%d\n", __func__, retval); + dev_err(&i2c->dev, "failed:%d\n", retval); retval = -EIO; } else retval = 1; @@ -830,8 +830,8 @@ static int synaptics_rmi4_i2c_query_device(struct synaptics_rmi4_data *pdata) /* Check if this is a Synaptics device - report if not. */ if (pdata->rmi4_mod_info.manufacturer_id != 1) - dev_err(&client->dev, "%s: non-Synaptics mfg id:%d\n", - __func__, pdata->rmi4_mod_info.manufacturer_id); + dev_err(&client->dev, "non-Synaptics mfg id:%d\n", + pdata->rmi4_mod_info.manufacturer_id); list_for_each_entry(rfi, &pdata->rmi4_mod_info.support_fn_list, link) data_sources += rfi->num_of_data_sources; @@ -990,8 +990,8 @@ static int synaptics_rmi4_probe platformdata->irq_type, DRIVER_NAME, rmi4_data); if (retval) { - dev_err(&client->dev, "%s:Unable to get attn irq %d\n", - __func__, client->irq); + dev_err(&client->dev, "Unable to get attn irq %d\n", + client->irq); goto err_query_dev; } -- 2.7.4