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:	Fri, 17 Apr 2009 21:07:52 +0200 (CEST)
From:	Guennadi Liakhovetski <g.liakhovetski@....de>
To:	Florian Fainelli <florian@...nwrt.org>
cc:	Peter Holik <peter@...ik.at>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb driver for intellon based PLC like devolo dlan duo

On Fri, 17 Apr 2009, Florian Fainelli wrote:

> > diff --git a/drivers/net/usb/intellon.c b/drivers/net/usb/intellon.c
> > new file mode 100644
> > index 0000000..c9fcc38
> > --- /dev/null
> > +++ b/drivers/net/usb/intellon.c
> > @@ -0,0 +1,273 @@
> > +/*
> > + * Copyright (c) 2009 Peter Holik
> > + *
> > + * Intellon PLC (Powerline Communications) usb net driver
> 
> Intellon INT51x1 PLC ...
> [snip]
> 
> > +
> > +static u8 nibble(unsigned char c)
> > +{
> > +	if (likely(isdigit(c)))
> > +		return c - '0';
> > +	c = toupper(c);
> > +	if (likely(isxdigit(c)))
> > +		return 10 + c - 'A';
> > +	return 0;
> > +}
> 
> Please prefix this with intellon_ (or int51x1_) for instance to avoid any 
> possible namespace clash.
> 
> > +
> > +static inline int get_ethernet_addr(struct usbnet *dev)
> > +{
> > +	int             tmp, i;
> > +	unsigned char   buf [13];
> > +
> > +	tmp = usb_string(dev->udev, 3, buf, sizeof buf);
> > +	if (tmp != 12) {
> > +		devdbg(dev, "bad MAC string fetch, %d\n", tmp);
> > +		if (tmp >= 0)
> > +			tmp = -EINVAL;
> > +		return tmp;
> > +	}
> > +	for (i = tmp = 0; i < 6; i++, tmp += 2)
> > +		dev->net->dev_addr [i] =
> > +			(nibble(buf [tmp]) << 4) + nibble(buf [tmp + 1]);
> > +	return 0;
> > +}
> 
> Same here.

FWIW, I think it's pretty common to name static functions in a .c file, 
which perform auxiliary function, not really specific to the context 
without the respective context-prefix. Of course, it might indeed happen 
that a global symbol "nibble" or "get_ethernet_addr" gets introduced at 
some point thus leading to a conflict, but this seems to be unlikely. And 
in any case the one who introduces such a symbol will have to grep the 
entire kernel anyway.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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