Skip to contentSkip to conversation

staging: i2o : Replace printk with dev_warn

PATCH In review Navya Sri Nizamkari 2 participants 5 messages Feb 20, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: i2o : Replace printk with dev_warn

This patch fixes the checkpatch.pl warning:
WARNING: Prefer netdev_info(netdev, ... then dev_info (dev, ... then pr_info(... to printk(KERN_INFO ...

i2o being a device driver, printk(KERN_WARNING can be replaced with the dev_warn function which is preferable.

---
 drivers/staging/i2o/exec-osm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/i2o/exec-osm.c +1 -1
index 16d857d..89e464d 100644
@@ -507,7 +507,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
 	 * to aid in debugging.
 	 *
 	 */
-	printk(KERN_WARNING "%s: Unsolicited message reply sent to core!"
+	dev_warn(c->pdev->dev, "%s: Unsolicited message reply sent to core!"
 	       "Message dumped to syslog\n", c->name);
 	i2o_dump_message(msg);
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · Navya Sri Nizamkari

This patch fixes the checkpatch.pl warning:
WARNING: Prefer netdev_info(netdev, ... then dev_info (dev, ... then pr_info(... to printk(KERN_INFO ...

i2o being a device driver, printk(KERN_WARNING can be replaced with the dev_warn function which is preferable.

---
 drivers/staging/i2o/exec-osm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/i2o/exec-osm.c +0 -0
index 16d857d..89e464d 100644

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, u32 m, · line 511

Quoted 6 lines
drivers/staging/i2o/exec-osm.c +1 -1
@@ -507,7 +507,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
 	 * to aid in debugging.
 	 *
 	 */
-	printk(KERN_WARNING "%s: Unsolicited message reply sent to core!"
+	dev_warn(c->pdev->dev, "%s: Unsolicited message reply sent to core!"
 	       "Message dumped to syslog\n", c->name);

I wonder if c->name is necessary if you are using dev_warn? Look at the definition of dev_warn and see if it already prints out something that looks like the name of the driver.

Another checkpatch warning would be about not breaking up strings. I'm surprised that it didn't complain about it.

julia

Quoted 12 lines
drivers/staging/i2o/exec-osm.c +0 -1
 	i2o_dump_message(msg);
 
--

1.9.1

--
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/1424446833-22298-1-git-send-email-navyasri.tech%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw

It did give a breaking up strings error. But I thought it would be better if I made another patch to address that. Indeed, it prints out the driver name. I'll change it in the patch.
Navya

Quoted 58 lines · Julia Lawall
Quoted 7 lines · Navya Sri Nizamkari

This patch fixes the checkpatch.pl warning:
WARNING: Prefer netdev_info(netdev, ... then dev_info (dev, ... then pr_info(... to printk(KERN_INFO ...

i2o being a device driver, printk(KERN_WARNING can be replaced with the dev_warn function which is preferable.

Review

Quoted 6 lines
Signed-off-by Navya Sri Nizamkari <[email protected] <javascript:>>

---

 drivers/staging/i2o/exec-osm.c | 2 +- 
 1 file changed, 1 insertion(+), 1 deletion(-) 
(quoted diff) +0 -0

b/drivers/staging/i2o/exec-osm.c

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c,

Quoted 4 lines

index 16d857d..89e464d 100644

drivers/staging/i2o/exec-osm.c +0 -0
@@ -507,7 +507,7 @@ static int i2o_exec_reply(struct i2o_controller *c, 

u32 m,

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, u32 m,

Quoted 4 lines
drivers/staging/i2o/exec-osm.c +0 -1
          * to aid in debugging. 
          * 
          */ 
-        printk(KERN_WARNING "%s: Unsolicited message reply sent to 

core!"

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, · line 510

Quoted 1 line
drivers/staging/i2o/exec-osm.c +1 -0
+        dev_warn(c->pdev->dev, "%s: Unsolicited message reply sent to 

core!"

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, u32 m, · line 511

Quoted 1 line
drivers/staging/i2o/exec-osm.c +0 -0
                "Message dumped to syslog\n", c->name); 

I wonder if c->name is necessary if you are using dev_warn? Look at the definition of dev_warn and see if it already prints out something that looks like the name of the driver.

Another checkpatch warning would be about not breaking up strings. I'm surprised that it didn't complain about it.

julia

Quoted 7 lines
drivers/staging/i2o/exec-osm.c +0 -0
         i2o_dump_message(msg); 
 
Signature · 4 lines
1.9.1 

-- 
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected] <javascript:>.

Quoted 1 line

To post to this group, send email to [email protected]

<javascript:>.

Quoted 1 line

To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/1424446833-22298-1-git-send-email-navyasri.tech%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#3 lore raw

As i2o is going to be taken out, is it okay if I send in a patch to remove the c-name or should I not?
Navya

Quoted 65 lines · Navya Sri Nizamkari

It did give a breaking up strings error. But I thought it would be better if I made another patch to address that. Indeed, it prints out the driver name. I'll change it in the patch.
Navya

Quoted 57 lines · Julia Lawall
Quoted 7 lines · Navya Sri Nizamkari

This patch fixes the checkpatch.pl warning:
WARNING: Prefer netdev_info(netdev, ... then dev_info (dev, ... then pr_info(... to printk(KERN_INFO ...

i2o being a device driver, printk(KERN_WARNING can be replaced with the dev_warn function which is preferable.

Review

Quoted 6 lines

---

 drivers/staging/i2o/exec-osm.c | 2 +- 
 1 file changed, 1 insertion(+), 1 deletion(-) 
(quoted diff) +0 -0

b/drivers/staging/i2o/exec-osm.c

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c,

Quoted 4 lines

index 16d857d..89e464d 100644

drivers/staging/i2o/exec-osm.c +0 -0
@@ -507,7 +507,7 @@ static int i2o_exec_reply(struct i2o_controller *c, 

u32 m,

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, u32 m,

Quoted 4 lines
drivers/staging/i2o/exec-osm.c +0 -1
          * to aid in debugging. 
          * 
          */ 
-        printk(KERN_WARNING "%s: Unsolicited message reply sent to 

core!"

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, · line 510

Quoted 1 line
drivers/staging/i2o/exec-osm.c +1 -0
+        dev_warn(c->pdev->dev, "%s: Unsolicited message reply sent to 

core!"

drivers/staging/i2o/exec-osm.c static int i2o_exec_reply(struct i2o_controller *c, u32 m, · line 511

Quoted 1 line
drivers/staging/i2o/exec-osm.c +0 -0
                "Message dumped to syslog\n", c->name); 

I wonder if c->name is necessary if you are using dev_warn? Look at the definition of dev_warn and see if it already prints out something that looks like the name of the driver.

Another checkpatch warning would be about not breaking up strings. I'm surprised that it didn't complain about it.

julia

Quoted 7 lines
drivers/staging/i2o/exec-osm.c +0 -0
         i2o_dump_message(msg); 
 
Signature · 4 lines
1.9.1 

-- 
You received this message because you are subscribed to the Google 

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

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/1424446833-22298-1-git-send-email-navyasri.tech%40gmail.com.

Quoted 2 lines

For more options, visit https://groups.google.com/d/optout.

#4 lore raw
Quoted 2 lines · Navya Sri Nizamkari

As i2o is going to be taken out, is it okay if I send in a patch to remove the c-name or should I not?

It seems more useful to move on to do something else.

Maybe you can find the same issue in some other code.

julia

Quoted 90 lines

Navya

On Friday, February 20, 2015 at 10:01:15 PM UTC+5:30, Navya Sri Nizamkari wrote:
It did give a breaking up strings error. But I thought it would be better if I made another patch to address that. Indeed, it prints out the driver name. I'll change it in the patch. Navya

On Friday, February 20, 2015 at 9:46:31 PM UTC+5:30, Julia Lawall wrote:
On Fri, 20 Feb 2015, Navya Sri Nizamkari wrote:

> This patch fixes the checkpatch.pl warning:
> WARNING: Prefer netdev_info(netdev, ... then dev_info
> (dev, ... then pr_info(...  to printk(KERN_INFO
...
>
> i2o being a device driver, printk(KERN_WARNING can be
> replaced with the dev_warn function which is preferable.
>
> Signed-off-by: Navya Sri Nizamkari <[email protected]>
> ---
>  drivers/staging/i2o/exec-osm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-) >
> diff --git a/drivers/staging/i2o/exec-osm.c b/drivers/staging/i2o/exec-osm.c
> index 16d857d..89e464d 100644
> --- a/drivers/staging/i2o/exec-osm.c
> +++ b/drivers/staging/i2o/exec-osm.c
> @@ -507,7 +507,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m, >           * to aid in debugging.
>           *
>           */
> -        printk(KERN_WARNING "%s: Unsolicited message reply sent to core!"
> +        dev_warn(c->pdev->dev, "%s: Unsolicited message reply sent to core!"
>                 "Message dumped to syslog\n", c->name);

I wonder if c->name is necessary if you are using dev_warn?  Look at the
definition of dev_warn and see if it already prints out something that
looks like the name of the driver.

Another checkpatch warning would be about not breaking up strings.  I'm
surprised that it didn't complain about it.

julia

>          i2o_dump_message(msg);
>
> --
> 1.9.1
>
> --
> 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 visithttps://groups.google.com/d/msgid/outreachy-kernel/1424446833-22298-1-git-s end-email-navyasri.tech%40gmail.com.
> For more options, visit
https://groups.google.com/d/optout.
>

--
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 visithttps://groups.google.com/d/msgid/outreachy-kernel/1f022876-2a76-49a1-916c- e00b9f24ee79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.