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]
Message-Id: <1193679799.3782.15.camel@lov.site>
Date:	Mon, 29 Oct 2007 18:43:19 +0100
From:	Kay Sievers <kay.sievers@...y.org>
To:	James Bottomley <James.Bottomley@...elEye.com>
Cc:	Greg KH <greg@...ah.com>, linux-scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sysfs: add filter function to groups

On Mon, 2007-10-29 at 12:28 -0500, James Bottomley wrote:
> On Mon, 2007-10-29 at 18:27 +0100, Kay Sievers wrote:
> > On Mon, 2007-10-29 at 11:57 -0500, James Bottomley wrote:
> > > On Mon, 2007-10-29 at 17:54 +0100, Kay Sievers wrote:
> > > > On Mon, 2007-10-29 at 10:16 -0500, James Bottomley wrote:
> > 
> > > > >  struct attribute_group {
> > > > >  	const char		*name;
> > > > > +	int			(*filter_show)(struct kobject *, int);
> > > > 
> > > > Are you sure that you want to return an array index here, instead of the
> > > > actual attribute? Like:
> > > 
> > > Actually, it returns a true/false value indicating whether the given
> > > attribute should be displayed.
> > 
> > It isn't about the return value of the function, that's fine. You call
> > back with the index number (int) of the array of attributes, instead of
> > passing the attribute pointer (struct attribute *attr) back to ask the
> > device for the attribute to create.
> 
> For bitmaps, the int is what we will want.  I can add both to the
> prototype if that will make you happy? so people searching on struct
> attribute and not relying on the array construction order can use the
> code as well.

Having both parameters sounds fine. Otherwise, if the code is spread
around several files, the attribute arrays would need to be global to
handle the callbacks, which isn't too nice.

Thanks,
Kay

-
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