All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
@ 2018-03-04 20:49 ` Arushi Singhal
  0 siblings, 0 replies; 7+ messages in thread
From: Arushi Singhal @ 2018-03-04 20:49 UTC (permalink / raw)
  To: gregkh; +Cc: netdev, devel, linux-kernel, outreachy-kernel

Replace printk having a log level with the appropriate
net_*macro_ratelimited.
It's better to use actual device name as a prefix in error messages.
Indentation is also changed, to fix the  checkpatch issue.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
changes in v2
*In previous version printk was changed to pr_*macro(), which is used
in kernel instead of calling printk() directly. And for drivers,
dev_*macro() or net_*macro_ratelimited() should be used for calling
printk() directly.

 drivers/staging/ipx/af_ipx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ipx/af_ipx.c b/drivers/staging/ipx/af_ipx.c
index d21a9d1..9a96962 100644
--- a/drivers/staging/ipx/af_ipx.c
+++ b/drivers/staging/ipx/af_ipx.c
@@ -744,13 +744,13 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
 			intrfc->if_netnum = cb->ipx_source_net;
 			ipxitf_add_local_route(intrfc);
 		} else {
-			printk(KERN_WARNING "IPX: Network number collision "
-				"%lx\n        %s %s and %s %s\n",
-				(unsigned long) ntohl(cb->ipx_source_net),
-				ipx_device_name(i),
-				ipx_frame_name(i->if_dlink_type),
-				ipx_device_name(intrfc),
-				ipx_frame_name(intrfc->if_dlink_type));
+			net_warn_ratelimited("IPX: Network number collision "
+					     "%lx\n        %s %s and %s %s\n",
+					     (unsigned long) ntohl(cb->ipx_source_net),
+					     ipx_device_name(i),
+					     ipx_frame_name(i->if_dlink_type),
+					     ipx_device_name(intrfc),
+					     ipx_frame_name(intrfc->if_dlink_type));
 			ipxitf_put(i);
 		}
 	}
-- 
2.7.4



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

* [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
@ 2018-03-04 20:49 ` Arushi Singhal
  0 siblings, 0 replies; 7+ messages in thread
From: Arushi Singhal @ 2018-03-04 20:49 UTC (permalink / raw)
  To: gregkh; +Cc: devel, netdev, linux-kernel, outreachy-kernel

Replace printk having a log level with the appropriate
net_*macro_ratelimited.
It's better to use actual device name as a prefix in error messages.
Indentation is also changed, to fix the  checkpatch issue.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
changes in v2
*In previous version printk was changed to pr_*macro(), which is used
in kernel instead of calling printk() directly. And for drivers,
dev_*macro() or net_*macro_ratelimited() should be used for calling
printk() directly.

 drivers/staging/ipx/af_ipx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ipx/af_ipx.c b/drivers/staging/ipx/af_ipx.c
index d21a9d1..9a96962 100644
--- a/drivers/staging/ipx/af_ipx.c
+++ b/drivers/staging/ipx/af_ipx.c
@@ -744,13 +744,13 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
 			intrfc->if_netnum = cb->ipx_source_net;
 			ipxitf_add_local_route(intrfc);
 		} else {
-			printk(KERN_WARNING "IPX: Network number collision "
-				"%lx\n        %s %s and %s %s\n",
-				(unsigned long) ntohl(cb->ipx_source_net),
-				ipx_device_name(i),
-				ipx_frame_name(i->if_dlink_type),
-				ipx_device_name(intrfc),
-				ipx_frame_name(intrfc->if_dlink_type));
+			net_warn_ratelimited("IPX: Network number collision "
+					     "%lx\n        %s %s and %s %s\n",
+					     (unsigned long) ntohl(cb->ipx_source_net),
+					     ipx_device_name(i),
+					     ipx_frame_name(i->if_dlink_type),
+					     ipx_device_name(intrfc),
+					     ipx_frame_name(intrfc->if_dlink_type));
 			ipxitf_put(i);
 		}
 	}
-- 
2.7.4

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

* Re: [Outreachy kernel] [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
  2018-03-04 20:49 ` Arushi Singhal
  (?)
@ 2018-03-04 20:54 ` Julia Lawall
  2018-03-04 21:48   ` Arushi Singhal
  -1 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2018-03-04 20:54 UTC (permalink / raw)
  To: Arushi Singhal; +Cc: gregkh, netdev, devel, linux-kernel, outreachy-kernel



On Mon, 5 Mar 2018, Arushi Singhal wrote:

> Replace printk having a log level with the appropriate
> net_*macro_ratelimited.

Why did you choose this function?

> It's better to use actual device name as a prefix in error messages.

What does this message relate to.

> Indentation is also changed, to fix the  checkpatch issue.

It would be better to no exceed 80 characters than to follow the
suggestion abotu the argument being to the right of the (.

julia


> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *In previous version printk was changed to pr_*macro(), which is used
> in kernel instead of calling printk() directly. And for drivers,
> dev_*macro() or net_*macro_ratelimited() should be used for calling
> printk() directly.
>
>  drivers/staging/ipx/af_ipx.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/ipx/af_ipx.c b/drivers/staging/ipx/af_ipx.c
> index d21a9d1..9a96962 100644
> --- a/drivers/staging/ipx/af_ipx.c
> +++ b/drivers/staging/ipx/af_ipx.c
> @@ -744,13 +744,13 @@ static void ipxitf_discover_netnum(struct ipx_interface *intrfc,
>  			intrfc->if_netnum = cb->ipx_source_net;
>  			ipxitf_add_local_route(intrfc);
>  		} else {
> -			printk(KERN_WARNING "IPX: Network number collision "
> -				"%lx\n        %s %s and %s %s\n",
> -				(unsigned long) ntohl(cb->ipx_source_net),
> -				ipx_device_name(i),
> -				ipx_frame_name(i->if_dlink_type),
> -				ipx_device_name(intrfc),
> -				ipx_frame_name(intrfc->if_dlink_type));
> +			net_warn_ratelimited("IPX: Network number collision "
> +					     "%lx\n        %s %s and %s %s\n",
> +					     (unsigned long) ntohl(cb->ipx_source_net),
> +					     ipx_device_name(i),
> +					     ipx_frame_name(i->if_dlink_type),
> +					     ipx_device_name(intrfc),
> +					     ipx_frame_name(intrfc->if_dlink_type));
>  			ipxitf_put(i);
>  		}
>  	}
> --
> 2.7.4
>
> --
> 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 post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180304204910.GA4840%40seema-Inspiron-15-3567.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
  2018-03-04 20:54 ` [Outreachy kernel] " Julia Lawall
@ 2018-03-04 21:48   ` Arushi Singhal
  0 siblings, 0 replies; 7+ messages in thread
From: Arushi Singhal @ 2018-03-04 21:48 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg KH, Linux Kernel Network Developers, driverdevel, LKML,
	outreachy-kernel

[-- Attachment #1: Type: text/plain, Size: 3198 bytes --]

On Mon, Mar 5, 2018 at 2:24 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:

>
>
> On Mon, 5 Mar 2018, Arushi Singhal wrote:
>
> > Replace printk having a log level with the appropriate
> > net_*macro_ratelimited.
>
> Why did you choose this function?
>
> > It's better to use actual device name as a prefix in error messages.
>
> What does this message relate to.
>
> > Indentation is also changed, to fix the  checkpatch issue.
>
> It would be better to no exceed 80 characters than to follow the
> suggestion abotu the argument being to the right of the (.
>

Thanks for the suggestion. Will send the new version.

>
> julia
>
>
> > Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> > ---
> > changes in v2
> > *In previous version printk was changed to pr_*macro(), which is used
> > in kernel instead of calling printk() directly. And for drivers,
> > dev_*macro() or net_*macro_ratelimited() should be used for calling
> > printk() directly.
> >
> >  drivers/staging/ipx/af_ipx.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/staging/ipx/af_ipx.c b/drivers/staging/ipx/af_ipx.c
> > index d21a9d1..9a96962 100644
> > --- a/drivers/staging/ipx/af_ipx.c
> > +++ b/drivers/staging/ipx/af_ipx.c
> > @@ -744,13 +744,13 @@ static void ipxitf_discover_netnum(struct
> ipx_interface *intrfc,
> >                       intrfc->if_netnum = cb->ipx_source_net;
> >                       ipxitf_add_local_route(intrfc);
> >               } else {
> > -                     printk(KERN_WARNING "IPX: Network number collision
> "
> > -                             "%lx\n        %s %s and %s %s\n",
> > -                             (unsigned long) ntohl(cb->ipx_source_net),
> > -                             ipx_device_name(i),
> > -                             ipx_frame_name(i->if_dlink_type),
> > -                             ipx_device_name(intrfc),
> > -                             ipx_frame_name(intrfc->if_dlink_type));
> > +                     net_warn_ratelimited("IPX: Network number
> collision "
> > +                                          "%lx\n        %s %s and %s
> %s\n",
> > +                                          (unsigned long)
> ntohl(cb->ipx_source_net),
> > +                                          ipx_device_name(i),
> > +                                          ipx_frame_name(i->if_dlink_
> type),
> > +                                          ipx_device_name(intrfc),
> > +                                          ipx_frame_name(intrfc->if_
> dlink_type));
> >                       ipxitf_put(i);
> >               }
> >       }
> > --
> > 2.7.4
> >
> > --
> > 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 post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/
> msgid/outreachy-kernel/20180304204910.GA4840%40seema-Inspiron-15-3567.
> > For more options, visit https://groups.google.com/d/optout.
> >
>

[-- Attachment #2: Type: text/html, Size: 4953 bytes --]

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

* Re: [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
  2018-03-04 20:49 ` Arushi Singhal
  (?)
@ 2018-03-06 11:59   ` Greg KH
  -1 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2018-03-06 11:59 UTC (permalink / raw)
  To: Arushi Singhal; +Cc: devel, netdev, linux-kernel, outreachy-kernel

On Mon, Mar 05, 2018 at 02:19:11AM +0530, Arushi Singhal wrote:
> Replace printk having a log level with the appropriate
> net_*macro_ratelimited.
> It's better to use actual device name as a prefix in error messages.
> Indentation is also changed, to fix the  checkpatch issue.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *In previous version printk was changed to pr_*macro(), which is used
> in kernel instead of calling printk() directly. And for drivers,
> dev_*macro() or net_*macro_ratelimited() should be used for calling
> printk() directly.
> 
>  drivers/staging/ipx/af_ipx.c | 14 +++++++-------

Please read drivers/staging/ipx/TODO

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
@ 2018-03-06 11:59   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2018-03-06 11:59 UTC (permalink / raw)
  To: Arushi Singhal; +Cc: devel, netdev, linux-kernel, outreachy-kernel

On Mon, Mar 05, 2018 at 02:19:11AM +0530, Arushi Singhal wrote:
> Replace printk having a log level with the appropriate
> net_*macro_ratelimited.
> It's better to use actual device name as a prefix in error messages.
> Indentation is also changed, to fix the  checkpatch issue.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *In previous version printk was changed to pr_*macro(), which is used
> in kernel instead of calling printk() directly. And for drivers,
> dev_*macro() or net_*macro_ratelimited() should be used for calling
> printk() directly.
> 
>  drivers/staging/ipx/af_ipx.c | 14 +++++++-------

Please read drivers/staging/ipx/TODO

thanks,

greg k-h

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

* Re: [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited()
@ 2018-03-06 11:59   ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2018-03-06 11:59 UTC (permalink / raw)
  To: Arushi Singhal; +Cc: netdev, devel, linux-kernel, outreachy-kernel

On Mon, Mar 05, 2018 at 02:19:11AM +0530, Arushi Singhal wrote:
> Replace printk having a log level with the appropriate
> net_*macro_ratelimited.
> It's better to use actual device name as a prefix in error messages.
> Indentation is also changed, to fix the  checkpatch issue.
> 
> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> changes in v2
> *In previous version printk was changed to pr_*macro(), which is used
> in kernel instead of calling printk() directly. And for drivers,
> dev_*macro() or net_*macro_ratelimited() should be used for calling
> printk() directly.
> 
>  drivers/staging/ipx/af_ipx.c | 14 +++++++-------

Please read drivers/staging/ipx/TODO

thanks,

greg k-h


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

end of thread, other threads:[~2018-03-06 11:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-04 20:49 [PATCH v2] staging: Replace printk() with appropriate net_*macro_ratelimited() Arushi Singhal
2018-03-04 20:49 ` Arushi Singhal
2018-03-04 20:54 ` [Outreachy kernel] " Julia Lawall
2018-03-04 21:48   ` Arushi Singhal
2018-03-06 11:59 ` Greg KH
2018-03-06 11:59   ` Greg KH
2018-03-06 11:59   ` Greg KH

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.