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:	Tue, 18 Oct 2011 07:41:09 -0700
From:	Greg KH <gregkh@...e.de>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Lee Jones <lee.jones@...aro.org>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	linus.walleij@...ricsson.com, jamie@...ieiles.com
Subject: Re: [PATCH 2/6] drivers/base: add bus for System-on-Chip devices

On Tue, Oct 18, 2011 at 04:14:02PM +0200, Arnd Bergmann wrote:
> On Tuesday 18 October 2011, Lee Jones wrote:
> > >> +struct device *soc_device_register(struct soc_device_attribute *soc_dev_attr)
> > >> +{
> > >> +    struct soc_device *soc_dev;
> > >> +    static atomic_t soc_device_num = ATOMIC_INIT(0);
> > > 
> > > No, please don't do this, use the proper kernel interface to dynamically
> > > handle numbering devices (hint, if you unload a SOC device, you will
> > > never reclaim that device number, which isn't that nice.)
> > 
> > Again, some help would really be appreciated here. I searched the kernel
> > last time you mentioned numbering, but this is all I came up with.
> 
> I guess the correct interface to use here would be an "ida", see
> linux/idr.h. However, I'm not convinced that's actually worth the
> extra space for maintaining it here.

Why?  That is the interface for this type of thing, it's very simple to
use, and it handles all of the logic for you for this type of thing.

Please don't roll your own solutions for things when there is already
code in the kernel to do it.

> IMHO, we could also remove the soc_device_unregister() function entirely
> and add a comment along the lines of 
> /*
>  * If you really need to add hot-pluggable soc_devices, add a
>  * soc_device_unregister function and turn the number generation
>  * into an IDA.
>  */

No, please provide this.  I want to see it tested, as when it is, then
the code will be fixed properly as right now it does some things it
shouldn't be doing in this regard.

greg k-h
--
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