Skip to contentSkip to conversation

staging: comedi: Use '"%s:", __func__' instead of function name

PATCH In review Eisha Chen-yen-su 3 participants 3 messages Feb 18, 2018 – Feb 19, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: comedi: Use '"%s:", __func__' instead of function name

Replace an occurrence of the function name in a string by a reference to __func__, to improve robustness. Problem found with checkpatch.

---
Changes in v2:
- Improve the commit message to emphasize on what was done and why. And make use of the imperative.

 drivers/staging/comedi/drivers/s626.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/s626.c +1 -1
index 0b3cfe934e14..ec54dc3e9ad6 100644
@@ -1700,7 +1700,7 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
 	if (devpriv->ai_cmd_running) {
 		dev_err(dev->class_dev,
-			"s626_ai_cmd: Another ai_cmd is running\n");
+			"%s: Another ai_cmd is running\n", __func__);
 		return -EBUSY;
 	}
 	/* disable interrupt */

--
2.14.3

Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · Eisha Chen-yen-su

Replace an occurrence of the function name in a string by a reference to __func__, to improve robustness. Problem found with checkpatch.

Looks good!

Quoted 31 lines

---
Changes in v2:
- Improve the commit message to emphasize on what was done and why. And make use of the imperative.

 drivers/staging/comedi/drivers/s626.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/s626.c +1 -2
index 0b3cfe934e14..ec54dc3e9ad6 100644
@@ -1700,7 +1700,7 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
 	if (devpriv->ai_cmd_running) {
 		dev_err(dev->class_dev,
-			"s626_ai_cmd: Another ai_cmd is running\n");
+			"%s: Another ai_cmd is running\n", __func__);
 		return -EBUSY;
 	}
 	/* disable interrupt */
--

2.14.3

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180218132707.3300-1-chenyensu0%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reviewed-by on v2 1/1
#2 lore raw
In reply to Eisha Chen-yen-su
Quoted 26 lines · Eisha Chen-yen-su

Replace an occurrence of the function name in a string by a reference to __func__, to improve robustness. Problem found with checkpatch.

---
Changes in v2:
- Improve the commit message to emphasize on what was done and why. And make use of the imperative.

  drivers/staging/comedi/drivers/s626.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/s626.c +1 -2
index 0b3cfe934e14..ec54dc3e9ad6 100644
@@ -1700,7 +1700,7 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
  	if (devpriv->ai_cmd_running) {
  		dev_err(dev->class_dev,
-			"s626_ai_cmd: Another ai_cmd is running\n");
+			"%s: Another ai_cmd is running\n", __func__);
  		return -EBUSY;
  	}
  	/* disable interrupt */
--
Quoted 2 lines

2.14.3

Looks good, thanks!

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-