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 70DB9C4707A for ; Fri, 21 May 2021 18:42:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45E7261175 for ; Fri, 21 May 2021 18:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238743AbhEUSnZ (ORCPT ); Fri, 21 May 2021 14:43:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:46294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbhEUSnY (ORCPT ); Fri, 21 May 2021 14:43:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8983961164; Fri, 21 May 2021 18:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621622520; bh=mHstAhsNVLcZ4YwoT78zqNPxk9UDVraUls14kh/fRLs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sq53wPGHO7XC6TzWDYnBz1YRQ8xUMhmOXPUQeKf6R0pWYKOi4kIW7wE/81Rbg+lpD whs/SCN8tPP+DMDKUrKAK7cWXMg+uecuohQg3rU0m4MFm7fSWKEiEwM1tVeYJmzjc5 m25fpPyrUroHo2TzgA/96BDE+YcklpHU0nUrxxTc= Date: Fri, 21 May 2021 20:41:57 +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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 08:41:28PM +0200, Greg Kroah-Hartman wrote: > 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 Oh wait, I'm the maintainer of the other file that uses this, I'll take both of these then :) thanks, greg k-h