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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 66D21C47076 for ; Fri, 21 May 2021 18:45:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E08E61163 for ; Fri, 21 May 2021 18:45:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239054AbhEUSqi (ORCPT ); Fri, 21 May 2021 14:46:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbhEUSqh (ORCPT ); Fri, 21 May 2021 14:46:37 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF9D3C061574 for ; Fri, 21 May 2021 11:45:13 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id b7so11036757wmh.5 for ; Fri, 21 May 2021 11:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rJGJXprpTKILrZaxFSGW7s+yTHWLxKatKlSr8cuQGgM=; b=QmC+zfCDoxapBeWsj/1Kp3xCVqHKtdsW7aDJfzuXvw2u2iuNgfMOJEId2VME6+10aT phjOwMSbFqAn8PUGnp+zuPQCRR4TPw0hoODk2sB1OGD20bhsthamnTgD17fkBHG4Oiif xY9+dUjv5V+DpFbB8BNelqNj1bP47fBcsKurPzJ+OjlPuiQH/l9se8fMYfPpmU+Hpxqr kCUlSZS1qCvqoU5jF3aCMNcFJTpvTHavessBjkj0kt2HEZH5IvPNfsqRZvB28bXhRq1q 9Jvg8+nQVvfjXnota3LZMClvEN0inBRfBuRlsYj+JLlm06jhd6BeW45bXmOQcHKUMiqS U3qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rJGJXprpTKILrZaxFSGW7s+yTHWLxKatKlSr8cuQGgM=; b=WemF1XCWaKZQf68plK55qKP4TkmdQya76/HzdChaRvGn8r65hE5+j7O9p7Gy1BRZBX M/AeAZTyY4Cr5KsN1zz2skml3UFP719oZ97TDvWzcClVPeueRq5No6MoqMxsOZu9JHpY tKRkgN3jJPHTCt6F5dANoyQ3Ff40VgrKOMlHo1zLMsx+AFvW/hfHRc3xehclPNyvE82B fZZd8Q1mvDbPCSYK4/f0D4As9/i4l334b/51rN8zvjJEOyk8Hk+XBifkugiNHjrVC2Iw d0jTLFg9K+18cQ8IK2efT5lBoPgqly7sJK/lllZWSVeoXDQP2m86PvERS32x7ptaOASr s4KA== X-Gm-Message-State: AOAM532f9vDCvm0JrrU07SnAyxkXGyzimePdOudaN2WSwTs1dUXwjmFS ErbXlyPvJVf8S6H0+TbHkuWQm0ENat0= X-Google-Smtp-Source: ABdhPJySEB2vLauRw1fX4DCpSwxDOz6LEcupt1GWmNV05JV/wqot+4M4OL+ihQJW2Wt9esIvnNuvzA== X-Received: by 2002:a1c:cc05:: with SMTP id h5mr10358192wmb.92.1621622712094; Fri, 21 May 2021 11:45:12 -0700 (PDT) Received: from ?IPv6:2003:ea:8f38:4600:3901:4092:a56:60d4? (p200300ea8f384600390140920a5660d4.dip0.t-ipconnect.de. [2003:ea:8f38:4600:3901:4092:a56:60d4]) by smtp.googlemail.com with ESMTPSA id n6sm326906wmq.34.2021.05.21.11.45.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 May 2021 11:45:11 -0700 (PDT) Subject: Re: [PATCH 1/2] sysfs: Add helper BIN_ATTRIBUTE_GROUPS To: Greg Kroah-Hartman Cc: Arnd Bergmann , "Rafael J. Wysocki" , Linux Kernel Mailing List References: <66e9f6e5-fdee-6963-6131-228c69705350@gmail.com> <1facebe2-1368-9b52-e0a1-f7a6eafc91ea@gmail.com> From: Heiner Kallweit Message-ID: Date: Fri, 21 May 2021 20:45:04 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.05.2021 20:41, Greg Kroah-Hartman wrote: > 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 :) > Even better, thanks! > thanks, > > greg k-h > Heiner