Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756866AbXJaJwx (ORCPT ); Wed, 31 Oct 2007 05:52:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753580AbXJaJwn (ORCPT ); Wed, 31 Oct 2007 05:52:43 -0400 Received: from einhorn.in-berlin.de ([192.109.42.8]:52249 "EHLO einhorn.in-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbXJaJwm (ORCPT ); Wed, 31 Oct 2007 05:52:42 -0400 X-Envelope-From: stefanr@s5r6.in-berlin.de Message-ID: <47285063.1040508@s5r6.in-berlin.de> Date: Wed, 31 Oct 2007 10:52:35 +0100 From: Stefan Richter User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070807 SeaMonkey/1.1.4 MIME-Version: 1.0 To: Cornelia Huck CC: Greg KH , James Bottomley , Kay Sievers , linux-scsi , linux-kernel Subject: Re: [PATCH] sysfs: add filter function to groups References: <1193671019.3383.13.camel@localhost.localdomain> <1193676852.2655.21.camel@lov.site> <1193677071.3383.56.camel@localhost.localdomain> <47261F50.3050901@s5r6.in-berlin.de> <1193768743.3321.91.camel@localhost.localdomain> <20071031035506.GH14910@kroah.com> <20071031104103.13e07d8f@gondolin.boeblingen.de.ibm.com> In-Reply-To: <20071031104103.13e07d8f@gondolin.boeblingen.de.ibm.com> X-Enigmail-Version: 0.95.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1022 Lines: 32 Cornelia Huck wrote: > Greg KH wrote: >> On Tue, Oct 30, 2007 at 01:25:43PM -0500, James Bottomley wrote: >>> + for (i = 0, attr = grp->attrs; *attr; i++, attr++) >>> + if (grp->is_visible && >>> + grp->is_visible(kobj, *attr, i)) >>> + sysfs_hash_and_remove(dir_sd, (*attr)->name); >> Hm, doesn't this break for the zillions of attribute groups that do not >> have the is_visible function set? ... > Would it make more sense then to turn the meaning of the callback > around? > > for (...) { > if (grp->mask_out && grp->mask_out(kobj, *attr, i)) > continue; > error |= sysfs_add_file(...); > } if (!grp->is_visible || grp->is_visible(kobj, *attr, i)) add or remove(); -- Stefan Richter -=====-=-=== =-=- ===== http://arcgraph.de/sr/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/