Staging: ste_rmi4: clean dev_err logging
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Fri, 6 Mar 2015 19:07:13 +0000 (22:07 +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/ste_rmi4/synaptics_i2c_rmi4.c

index f92ae1d24f9f9a5ba417777294e8c2eb2ce428ea..6385b336bd0dc940fb9fc823b9246f58d213fd62 100644 (file)
@@ -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;
        }