Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Stephen Hemminger wrote: On Mon, 11 Jun 2007 14:37:21 -0700 Auke Kok <[EMAIL PROTECTED]> wrote: A lot of netdevices implement their own variant of printk and use use variations of dev_printk, printk or others that use msg_enable, which has been an eyesore with countless variations across driver

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Joe Perches
On Mon, 2007-06-11 at 15:01 -0700, Kok, Auke wrote: > > msg_enable is more frequently defined in drivers/net as u32 not int. > yes, we're only using the bottom 15 bits anyway, but the net_device struct > consistently uses 'int' style members, leaving it up to the compiler to pick > an > appropri

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Stephen Hemminger
On Mon, 11 Jun 2007 14:37:21 -0700 Auke Kok <[EMAIL PROTECTED]> wrote: > A lot of netdevices implement their own variant of printk and use > use variations of dev_printk, printk or others that use msg_enable, > which has been an eyesore with countless variations across drivers. > > This patch imp

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Randy Dunlap wrote: On Mon, 11 Jun 2007 14:37:21 -0700 Auke Kok wrote: include/linux/netdevice.h | 38 ++ net/core/dev.c|5 + net/core/ethtool.c| 14 +++--- 3 files changed, 50 insertions(+), 7 deletions(-) diff --git

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Joe Perches wrote: On Mon, 2007-06-11 at 14:37 -0700, Auke Kok wrote: diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3a70f55..d185f41 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -540,6 +540,8 @@ struct net_device struct device

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Randy Dunlap
On Mon, 11 Jun 2007 14:37:21 -0700 Auke Kok wrote: > include/linux/netdevice.h | 38 ++ > net/core/dev.c|5 + > net/core/ethtool.c| 14 +++--- > 3 files changed, 50 insertions(+), 7 deletions(-) > > diff --git a/include/

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Joe Perches
On Mon, 2007-06-11 at 14:37 -0700, Auke Kok wrote: > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index 3a70f55..d185f41 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -540,6 +540,8 @@ struct net_device > struct device dev; >

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Auke Kok wrote: A lot of netdevices implement their own variant of printk and use use variations of dev_printk, printk or others that use msg_enable, which has been an eyesore with countless variations across drivers. +#define ndev_err(netdev, level, format, arg...) \ + do { if ((netde

[PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Auke Kok
A lot of netdevices implement their own variant of printk and use use variations of dev_printk, printk or others that use msg_enable, which has been an eyesore with countless variations across drivers. This patch implements a standard ndev_printk and derivatives such as ndev_err, ndev_info, ndev_w

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Joe Perches wrote: I like the ndev_printk idea. I think a ndev_ printks should take a const netdev* as the first argument. Also, better for the non-debug use of ndev_dbg is to have a static inline function so printf args are verified. For instance, dev_dbg does: static inline int __attribute_

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Joe Perches
I like the ndev_printk idea. I think a ndev_ printks should take a const netdev* as the first argument. Also, better for the non-debug use of ndev_dbg is to have a static inline function so printf args are verified. For instance, dev_dbg does: static inline int __attribute__ ((format (printf, 2

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Stephen Hemminger
On Mon, 11 Jun 2007 10:30:26 -0700 "Kok, Auke" <[EMAIL PROTECTED]> wrote: > Stephen Hemminger wrote: > > On Fri, 08 Jun 2007 16:42:31 -0700 > > "Kok, Auke" <[EMAIL PROTECTED]> wrote: > > > >> Stephen Hemminger wrote: > > +#define ndev_printk(kern_level, netif_level, netdev, format, ar

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-11 Thread Kok, Auke
Stephen Hemminger wrote: On Fri, 08 Jun 2007 16:42:31 -0700 "Kok, Auke" <[EMAIL PROTECTED]> wrote: Stephen Hemminger wrote: +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ + printk(kern

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Kok, Auke
Stephen Hemminger wrote: On Fri, 08 Jun 2007 16:42:31 -0700 "Kok, Auke" <[EMAIL PROTECTED]> wrote: Stephen Hemminger wrote: +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ + printk(kern

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Kok, Auke
Stephen Hemminger wrote: On Fri, 08 Jun 2007 16:42:31 -0700 "Kok, Auke" <[EMAIL PROTECTED]> wrote: Stephen Hemminger wrote: +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ + printk(kern

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Stephen Hemminger
On Fri, 08 Jun 2007 16:42:31 -0700 "Kok, Auke" <[EMAIL PROTECTED]> wrote: > Stephen Hemminger wrote: > >> > >> +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ > >> + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ > >> + printk(kern_level "%s: " for

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Kok, Auke
Stephen Hemminger wrote: +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ + printk(kern_level "%s: " format, \ + (netdev)->name, ## arg); } } while (0) Could you make a vers

Re: [PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Stephen Hemminger
> > +#define ndev_printk(kern_level, netif_level, netdev, format, arg...) \ > + do { if ((netdev)->msg_enable & NETIF_MSG_##netif_level) { \ > + printk(kern_level "%s: " format, \ > + (netdev)->name, ## arg); } } while (0) Could you make a version that doesn't evalua

[PATCH 1/2] [RFC] NET: Implement a standard ndev_printk family

2007-06-08 Thread Auke Kok
A lot of netdevices implement their own variant of printk and use use variations of dev_printk, printk or others that use msg_enable, which has been an eyesore with countless variations across drivers. This patch implements a standard ndev_printk and derivatives such as ndev_err, ndev_info, ndev_w