lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 14 Feb 2010 16:54:47 -0800
From:	Joe Perches <joe@...ches.com>
To:	Tilman Schmidt <tilman@...p.cc>
Cc:	David Miller <davem@...emloft.net>,
	David Brownell <david-b@...bell.net>,
	Greg Kroah-Hartman <gregkh@...e.de>, netdev@...r.kernel.org,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] usbnet: Convert dev(dbg|err|warn|info) macros to
 netdev_<level>

On Mon, 2010-02-15 at 01:17 +0100, Tilman Schmidt wrote: 
> Am 15.02.2010 00:01 schrieb Joe Perches:
> > Some logging messages were in the form:
> > 	printk(KERN_<level> "msg %s%s%s%s\n",
> > 	       value == 1 ? "one" : "",
> > 	       value == 2 ? "two" : "",
> > 	       value == 3 ? "three" : "",
> > 	       value == 4 ? "four" : "unknown");
> > Converted to:
> > 	printk(KERN_<level> "msg %s\n",
> > 	       value == 1 ? "one" :
> > 	       value == 2 ? "two" :
> > 	       value == 3 ? "three" :
> > 	       value == 4 ? "four" : "unknown");
> [...]
> > diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
> > index aeb1ab0..aa078f3 100644
> > --- a/drivers/net/usb/net1080.c
> > +++ b/drivers/net/usb/net1080.c
> > @@ -205,23 +205,24 @@ static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
> >  {
> >  	if (!netif_msg_link(dev))
> >  		return;
> > -	devdbg(dev, "net1080 %s-%s usbctl 0x%x:%s%s%s%s%s;"
> > -			" this%s%s;"
> > -			" other%s%s; r/o 0x%x",
> > -		dev->udev->bus->bus_name, dev->udev->devpath,
> > -		usbctl,
> > -		(usbctl & USBCTL_ENABLE_LANG) ? " lang" : "",
> > -		(usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" : "",
> > -		(usbctl & USBCTL_ENABLE_PROD) ? " prod" : "",
> > -		(usbctl & USBCTL_ENABLE_SERIAL) ? " serial" : "",
> > -		(usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
> > -
> > -		(usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" : "",
> > -		(usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
> > -		(usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" : "",
> > -		(usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
> > -		usbctl & ~USBCTL_WRITABLE_MASK
> > -		);
> > +	netdev_dbg(dev->net, "net1080 %s-%s usbctl 0x%x:%s;"
> > +		   " this%s;"
> > +		   " other%s; r/o 0x%x\n",
> > +		   dev->udev->bus->bus_name, dev->udev->devpath,
> > +		   usbctl,
> > +		   (usbctl & USBCTL_ENABLE_LANG) ? " lang" :
> > +		   (usbctl & USBCTL_ENABLE_MFGR) ? " mfgr" :
> > +		   (usbctl & USBCTL_ENABLE_PROD) ? " prod" :
> > +		   (usbctl & USBCTL_ENABLE_SERIAL) ? " serial" :
> > +		   (usbctl & USBCTL_ENABLE_DEFAULTS) ? " defaults" : "",
> > +
> > +		   (usbctl & USBCTL_FLUSH_OTHER) ? " FLUSH" :
> > +		   (usbctl & USBCTL_DISCONN_OTHER) ? " DIS" : "",
> > +
> > +		   (usbctl & USBCTL_FLUSH_THIS) ? " FLUSH" :
> > +		   (usbctl & USBCTL_DISCONN_THIS) ? " DIS" : "",
> > +
> > +		   usbctl & ~USBCTL_WRITABLE_MASK);
> >  }
> >  
> >  /*-------------------------------------------------------------------------*/
> 
> That doesn't look right. The original code concatenates all the strings
> corresponding to the set bits in usbctl. With your patch, it prints only
> the string corresponding to the first set bit it encounters within each
> group.

Hmm, right.  Stuffed that one up.  Thanks Tilman.

I'll resend in a bit after David Brownell or
someone else answers the inverted question below.

> Btw, is it intentional that the _OTHER values are printed after the
> label "this", and the _THIS values after the label "other"?

Thanks again, I saw that, but neglected to mention it.
David Brownell?  Do you know if that is inverted?

[]

> Same problem.

Right again.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ