All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haneen Mohammed <hamohammed.sa@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Subject: [PATCH v3 4/7] Staging: octeon-usb: Clean dev_err() logging
Date: Fri,  6 Mar 2015 00:48:33 +0300	[thread overview]
Message-ID: <1425592113-29734-1-git-send-email-hamohammed.sa@gmail.com> (raw)
In-Reply-To: <1425583768-27996-1-git-send-email-hamohammed.sa@gmail.com>

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;
expression  msg;
@@

dev_err(E, msg, __func__);

@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;
identifier  b.y;
@@

- dev_err(E, msg, __func__);
+ dev_err(E, y);

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
 drivers/staging/octeon-usb/octeon-hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 1daeb31..e892de2 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -1531,7 +1531,7 @@ static void __cvmx_usb_start_channel_control(struct cvmx_usb_state *usb,
 	switch (transaction->stage) {
 	case CVMX_USB_STAGE_NON_CONTROL:
 	case CVMX_USB_STAGE_NON_CONTROL_SPLIT_COMPLETE:
-		dev_err(dev, "%s: ERROR - Non control stage\n", __func__);
+		dev_err(dev, "ERROR - Non control stage\n");
 		break;
 	case CVMX_USB_STAGE_SETUP:
 		usbc_hctsiz.s.pid = 3; /* Setup */
-- 
1.9.1



  parent reply	other threads:[~2015-03-05 21:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 19:29 [PATCH 0/7] Staging: clean de_err() loging Haneen Mohammed
2015-03-05 19:31 ` [PATCH 1/7] Staging: media: Clean dev_err() logging Haneen Mohammed
2015-03-05 19:35 ` [PATCH 2/7] Staging: fbtft: " Haneen Mohammed
2015-03-05 19:37 ` [PATCH 3/7] Staging: iio: " Haneen Mohammed
2015-03-05 19:38 ` [PATCH 4/7] Staging: octeon-usb: " Haneen Mohammed
2015-03-05 19:38 ` [PATCH 5/7] Staging: slicoss: " Haneen Mohammed
2015-03-05 19:42 ` [PATCH 6/7] Staging: gdm72xx: " Haneen Mohammed
2015-03-05 19:43 ` [PATCH 7/7] Staging: ste_rmi4: " Haneen Mohammed
2015-03-05 20:40   ` [Outreachy kernel] " Julia Lawall
2015-03-05 21:02     ` Haneen Mohammed
2015-03-05 21:29 ` [PATCH v2 0/7] Staging: clean de_err() loging Haneen Mohammed
2015-03-05 21:36 ` [PATCH v3 0/7]Staging: " Haneen Mohammed
2015-03-05 21:42 ` [PATCH v3 1/7] Staging: media: Clean dev_err() logging Haneen Mohammed
2015-03-06 23:52   ` [Outreachy kernel] " Greg KH
2015-03-05 21:44 ` [PATCH v3 2/7] Staging: fbtft: " Haneen Mohammed
2015-03-05 21:46 ` [PATCH v3 3/7] Staging: iio: " Haneen Mohammed
2015-03-05 21:48 ` Haneen Mohammed [this message]
2015-03-05 21:50 ` [PATCH v3 5/7] Staging: slicoss: " Haneen Mohammed
2015-03-05 21:52 ` [PATCH v3 6/7] Staging: gdm72xx: " Haneen Mohammed
2015-03-05 21:55 ` [PATCH v3 7/7] Staging: ste_rmi4: " Haneen Mohammed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425592113-29734-1-git-send-email-hamohammed.sa@gmail.com \
    --to=hamohammed.sa@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.