From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B019C1A0730; Thu, 4 Jul 2024 10:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720088005; cv=none; b=TD+UUtZIoGlZoT16RG13rmI17WWY+Tl/VBmeIIl+rZ3Vk630RNXVHnLaFP1ql0ERvQVkihHN1CfRaTKzwt7DrYclkDiZpFc/Dvp79cyIq1s4wNtcb6OjA5eQMuWaCwLyx+Gcv4VM88vjoLfi3xrweL3O1dYs5XtkCwfScQD6+5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720088005; c=relaxed/simple; bh=ri7ZVe86JKjzpqC5bIJZsfQCruCljNSMit5y3s9O10Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZxrB4e+rMvB1UGf5wosN1Hh80FLQ6hq8zwZ7MCwD7zv+KCrjfqI6vU3j0dL8r1EpmQPNWJEJciDt/UDT+aAGWkasKUC0xCBqz+BWSD2xtmXYfBXzkyIHJ70Ag6sRJgXvDwWNyn2yDaLRToFZvFBPAOXgPdOdb92JJpE5aruxaxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uFhAScAX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uFhAScAX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0DD0C3277B; Thu, 4 Jul 2024 10:13:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720088005; bh=ri7ZVe86JKjzpqC5bIJZsfQCruCljNSMit5y3s9O10Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uFhAScAXFiwChxa8HylNZvkMtjjuThUbvzB34mYnKlzx+5MU5uBA4sRmI3pBCUeD0 FZbgnynyDvA/kEjLszVgvuVyfo1birpuzzKcO11QVrLAtH9IoUdsGpSSnGFHstEGkg hSwSk0SAvhFTd3U8yYSpgPZdR9YZFWlAKe12wHg0= Date: Thu, 4 Jul 2024 12:13:22 +0200 From: Greg Kroah-Hartman To: Lukas Wunner Cc: Jonathan Cameron , Bjorn Helgaas , David Howells , Herbert Xu , "David S. Miller" , David Woodhouse , James Bottomley , linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org, linux-coco@lists.linux.dev, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linuxarm@huawei.com, David Box , Dan Williams , "Li, Ming" , Ilpo Jarvinen , Alistair Francis , Wilfred Mallawa , Damien Le Moal , Alexey Kardashevskiy , Dhaval Giani , Gobikrishna Dhanuskodi , Jason Gunthorpe , Peter Gonda , Jerome Glisse , Sean Christopherson , Alexander Graf , Samuel Ortiz , Alan Stern Subject: Re: [PATCH v2 13/18] sysfs: Allow bin_attributes to be added to groups Message-ID: <2024070413-yeast-exposable-6d2d@gregkh> References: <16490618cbde91b5aac04873c39c8fb7666ff686.1719771133.git.lukas@wunner.de> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16490618cbde91b5aac04873c39c8fb7666ff686.1719771133.git.lukas@wunner.de> On Sun, Jun 30, 2024 at 09:48:00PM +0200, Lukas Wunner wrote: > Commit dfa87c824a9a ("sysfs: allow attributes to be added to groups") > introduced dynamic addition of sysfs attributes to groups. > > Allow the same for bin_attributes, in support of a subsequent commit > which adds various bin_attributes every time a PCI device is > authenticated. > > Addition of bin_attributes to groups differs from regular attributes in > that different kernfs_ops are selected by sysfs_add_bin_file_mode_ns() > vis-à-vis sysfs_add_file_mode_ns(). > > So call either of those two functions from sysfs_add_file_to_group() > based on an additional boolean parameter and add two wrapper functions, > one for bin_attributes and another for regular attributes. > > Removal of bin_attributes from groups does not require a differentiation > for bin_attributes and can use the same code path as regular attributes. > > Signed-off-by: Lukas Wunner > Cc: Alan Stern Acked-by: Greg Kroah-Hartman