All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Staging: hp: Replace printk(KERN_WARNING ...) with netdev_warn().
@ 2020-03-21 18:41 Sam Muhammed
  2020-03-21 18:48 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Muhammed @ 2020-03-21 18:41 UTC (permalink / raw)
  To: Jaroslav Kysela, Greg Kroah-Hartman, outreachy-kernel; +Cc: Sam Muhammed

Fixup the following checkpatch.pl WARNING:
WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ...
then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
---
Changes in v2:
- Removing " : " in the print message, netdev_warn() doesn't need it.

 drivers/staging/hp/hp100.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
index b89c4dcf53f5..1afd511260d0 100644
--- a/drivers/staging/hp/hp100.c
+++ b/drivers/staging/hp/hp100.c
@@ -469,8 +469,7 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,

 	eid = hp100_read_id(ioaddr);
 	if (eid == NULL) {	/* bad checksum? */
-		printk(KERN_WARNING "%s: bad ID checksum at base port 0x%x\n",
-		       __func__, ioaddr);
+		netdev_warn(dev, "bad ID checksum at base port 0x%x\n", ioaddr);
 		goto out2;
 	}

@@ -478,9 +477,9 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 	for (i = uc = 0; i < 7; i++)
 		uc += hp100_inb(LAN_ADDR + i);
 	if (uc != 0xff) {
-		printk(KERN_WARNING
-		       "%s: bad lan address checksum at port 0x%x)\n",
-		       __func__, ioaddr);
+		netdev_warn(dev,
+			    "bad lan address checksum at port 0x%x)\n",
+			    ioaddr);
 		err = -EIO;
 		goto out2;
 	}
---
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] Staging: hp: Replace printk(KERN_WARNING ...) with netdev_warn().
  2020-03-21 18:41 [PATCH v2] Staging: hp: Replace printk(KERN_WARNING ...) with netdev_warn() Sam Muhammed
@ 2020-03-21 18:48 ` Julia Lawall
  2020-03-21 18:59   ` Sam Muhammed
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2020-03-21 18:48 UTC (permalink / raw)
  To: Sam Muhammed; +Cc: Jaroslav Kysela, Greg Kroah-Hartman, outreachy-kernel



On Sat, 21 Mar 2020, Sam Muhammed wrote:

> Fixup the following checkpatch.pl WARNING:
> WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ...
> then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

Sorry to complain some more, but the subject line and the log message are
not really idea.  The subject line should be concise and get the main
point across, but doen't need a lot of detail.  So "use netdev_warn" could
be fine.  The log message is where you should explain what you do and why.
Your log message has a lot of words, but the only one that says what you
do is "Fixup", which is not very descriptive, and there is no mention of
why.

julia

>
> Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
> ---
> Changes in v2:
> - Removing " : " in the print message, netdev_warn() doesn't need it.
>
>  drivers/staging/hp/hp100.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
> index b89c4dcf53f5..1afd511260d0 100644
> --- a/drivers/staging/hp/hp100.c
> +++ b/drivers/staging/hp/hp100.c
> @@ -469,8 +469,7 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
>
>  	eid = hp100_read_id(ioaddr);
>  	if (eid == NULL) {	/* bad checksum? */
> -		printk(KERN_WARNING "%s: bad ID checksum at base port 0x%x\n",
> -		       __func__, ioaddr);
> +		netdev_warn(dev, "bad ID checksum at base port 0x%x\n", ioaddr);
>  		goto out2;
>  	}
>
> @@ -478,9 +477,9 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
>  	for (i = uc = 0; i < 7; i++)
>  		uc += hp100_inb(LAN_ADDR + i);
>  	if (uc != 0xff) {
> -		printk(KERN_WARNING
> -		       "%s: bad lan address checksum at port 0x%x)\n",
> -		       __func__, ioaddr);
> +		netdev_warn(dev,
> +			    "bad lan address checksum at port 0x%x)\n",
> +			    ioaddr);
>  		err = -EIO;
>  		goto out2;
>  	}
> ---
> 2.20.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200321184132.1908-1-jane.pnx9%40gmail.com.
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Outreachy kernel] [PATCH v2] Staging: hp: Replace printk(KERN_WARNING ...) with netdev_warn().
  2020-03-21 18:48 ` [Outreachy kernel] " Julia Lawall
@ 2020-03-21 18:59   ` Sam Muhammed
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Muhammed @ 2020-03-21 18:59 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Jaroslav Kysela, Greg Kroah-Hartman, outreachy-kernel

On Sat, 2020-03-21 at 19:48 +0100, Julia Lawall wrote:
> 
> On Sat, 21 Mar 2020, Sam Muhammed wrote:
> 
> > Fixup the following checkpatch.pl WARNING:
> > WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ...
> > then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
> 
> Sorry to complain some more, but the subject line and the log message are
> not really idea.  The subject line should be concise and get the main
> point across, but doen't need a lot of detail.  So "use netdev_warn" could
> be fine.  The log message is where you should explain what you do and why.
> Your log message has a lot of words, but the only one that says what you
> do is "Fixup", which is not very descriptive, and there is no mention of
> why.
> 

And I just thought it went smooth :D
Okay, v3 then.
Thank you!

Sam

> julia
> 
> >
> > Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
> > ---
> > Changes in v2:
> > - Removing " : " in the print message, netdev_warn() doesn't need it.
> >
> >  drivers/staging/hp/hp100.c | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/staging/hp/hp100.c b/drivers/staging/hp/hp100.c
> > index b89c4dcf53f5..1afd511260d0 100644
> > --- a/drivers/staging/hp/hp100.c
> > +++ b/drivers/staging/hp/hp100.c
> > @@ -469,8 +469,7 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
> >
> >  	eid = hp100_read_id(ioaddr);
> >  	if (eid == NULL) {	/* bad checksum? */
> > -		printk(KERN_WARNING "%s: bad ID checksum at base port 0x%x\n",
> > -		       __func__, ioaddr);
> > +		netdev_warn(dev, "bad ID checksum at base port 0x%x\n", ioaddr);
> >  		goto out2;
> >  	}
> >
> > @@ -478,9 +477,9 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
> >  	for (i = uc = 0; i < 7; i++)
> >  		uc += hp100_inb(LAN_ADDR + i);
> >  	if (uc != 0xff) {
> > -		printk(KERN_WARNING
> > -		       "%s: bad lan address checksum at port 0x%x)\n",
> > -		       __func__, ioaddr);
> > +		netdev_warn(dev,
> > +			    "bad lan address checksum at port 0x%x)\n",
> > +			    ioaddr);
> >  		err = -EIO;
> >  		goto out2;
> >  	}
> > ---
> > 2.20.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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200321184132.1908-1-jane.pnx9%40gmail.com.
> >




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-21 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-21 18:41 [PATCH v2] Staging: hp: Replace printk(KERN_WARNING ...) with netdev_warn() Sam Muhammed
2020-03-21 18:48 ` [Outreachy kernel] " Julia Lawall
2020-03-21 18:59   ` Sam Muhammed

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.