From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C6DEC47076 for ; Fri, 21 May 2021 18:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14C2E61164 for ; Fri, 21 May 2021 18:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236437AbhEUSmz (ORCPT ); Fri, 21 May 2021 14:42:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:46068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbhEUSmx (ORCPT ); Fri, 21 May 2021 14:42:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0833761163; Fri, 21 May 2021 18:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621622490; bh=nXFKjp9iGtwjkRW0R7cZgoSZErIoiQjCkATagLSNS3k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h7cWA/3j1e0WsSCDRMI029WQEqM0g5y/rWbg2xuiHyPw2ooZx3vTd9ga0vmpv1dz7 uqCwklA9DQ00yolZlvVLQtmL7JnSdeUYriyVNtxpHybOiXtqyeuxEQJfQpAZ6Whb8I ehkAkV6N/5+pavmXi4jzBJH03XnPYZrw4Gz3zimI= Date: Fri, 21 May 2021 20:41:28 +0200 From: Greg Kroah-Hartman To: Heiner Kallweit Cc: Arnd Bergmann , "Rafael J. Wysocki" , Linux Kernel Mailing List Subject: Re: [PATCH 1/2] sysfs: Add helper BIN_ATTRIBUTE_GROUPS Message-ID: References: <66e9f6e5-fdee-6963-6131-228c69705350@gmail.com> <1facebe2-1368-9b52-e0a1-f7a6eafc91ea@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1facebe2-1368-9b52-e0a1-f7a6eafc91ea@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 09:02:47PM +0200, Heiner Kallweit wrote: > On 19.05.2021 19:04, Greg Kroah-Hartman wrote: > > On Wed, May 19, 2021 at 06:33:14PM +0200, Heiner Kallweit wrote: > >> New helper BIN_ATTRIBUTE_GROUPS() does the same as ATTRIBUTE_GROUPS(), > >> just for binary attributes. > >> > >> Signed-off-by: Heiner Kallweit > >> --- > >> include/linux/sysfs.h | 6 ++++++ > >> 1 file changed, 6 insertions(+) > >> > >> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h > >> index d76a1ddf8..a12556a4b 100644 > >> --- a/include/linux/sysfs.h > >> +++ b/include/linux/sysfs.h > >> @@ -162,6 +162,12 @@ static const struct attribute_group _name##_group = { \ > >> }; \ > >> __ATTRIBUTE_GROUPS(_name) > >> > >> +#define BIN_ATTRIBUTE_GROUPS(_name) \ > >> +static const struct attribute_group _name##_group = { \ > >> + .bin_attrs = _name##_attrs, \ > >> +}; \ > >> +__ATTRIBUTE_GROUPS(_name) > > > > Is this really needed by more than just 1 driver? > > > Few more use case I saw: > devcd_dev_groups in drivers/base/devcoredump.c > w1_f3a_group in drivers/w1/slaves/w1_ds2413.c > w1_slave_default_groups in drivers/w1/w1.c Ok, might as well, can't hurt to add this :) Reviewed-by: Greg Kroah-Hartman