From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 7C68313C3CF for ; Thu, 18 Jul 2024 15:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721316136; cv=none; b=Urw2UrvMtcrM6zgYhNPw/W8Q2ADWV9TZHsAjXDZuN1SBp5fXU5L2nyA9D2Bv9UQJhRqR6U27hqreE/8fA6wnlnypGT94WRG0yBz11KhqXISIAAwdpW8mHkgyYgJ3FNTDlaJ4QVXEwJSmCqTjYmGIDPPM8FbIYQJxH9p6/qvFMuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721316136; c=relaxed/simple; bh=E533HHAhj/uoDBVDUL3yh1xvV9mHBjJwKPZdvRn1GGQ=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=azcF0Jqteskc3Tj9hXzpI+aGP3qO/XXIXark3zT07r5yFNnv7tbJxORunxk7QP5rBSksrDWB+WP3uelZVO62WfNgQiwkgTOi2rl4GcM+1e5tZ9+2W5jB8JEM+1OEtAXDZKNfW1VX4t26dFDMkHQcqGgyjB3jlmMXlmRkBtclat4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4WPxMk1FJQz6HJp8; Thu, 18 Jul 2024 23:20:50 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id B5CA7140B73; Thu, 18 Jul 2024 23:22:11 +0800 (CST) Received: from localhost (10.203.174.77) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 18 Jul 2024 16:22:11 +0100 Date: Thu, 18 Jul 2024 16:22:10 +0100 From: Jonathan Cameron To: Lukas Wunner CC: Bjorn Helgaas , David Howells , Herbert Xu , "David S. Miller" , David Woodhouse , "James Bottomley" , , , , , , , 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 , "Greg Kroah-Hartman" , Alan Stern Subject: Re: [PATCH v2 13/18] sysfs: Allow bin_attributes to be added to groups Message-ID: <20240718162210.000055ee@Huawei.com> In-Reply-To: <16490618cbde91b5aac04873c39c8fb7666ff686.1719771133.git.lukas@wunner.de> References: <16490618cbde91b5aac04873c39c8fb7666ff686.1719771133.git.lukas@wunner.de> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) 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-Transfer-Encoding: quoted-printable X-ClientProxiedBy: lhrpeml500002.china.huawei.com (7.191.160.78) To lhrpeml500005.china.huawei.com (7.191.163.240) On Sun, 30 Jun 2024 21:48:00 +0200 Lukas Wunner wrote: > Commit dfa87c824a9a ("sysfs: allow attributes to be added to groups") > introduced dynamic addition of sysfs attributes to groups. >=20 > Allow the same for bin_attributes, in support of a subsequent commit > which adds various bin_attributes every time a PCI device is > authenticated. >=20 > 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-=E0-vis sysfs_add_file_mode_ns(). >=20 > 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. >=20 > Removal of bin_attributes from groups does not require a differentiation > for bin_attributes and can use the same code path as regular attributes. >=20 > Signed-off-by: Lukas Wunner > Cc: Alan Stern Reviewed-by: Jonathan Cameron