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=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 A5F6CC3A5A5 for ; Tue, 3 Sep 2019 03:37:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 889ED214AE for ; Tue, 3 Sep 2019 03:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725870AbfICDhI (ORCPT ); Mon, 2 Sep 2019 23:37:08 -0400 Received: from ozlabs.org ([203.11.71.1]:45387 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfICDhI (ORCPT ); Mon, 2 Sep 2019 23:37:08 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 46Mt1C3FNgz9sDB; Tue, 3 Sep 2019 13:37:03 +1000 (AEST) From: Michael Ellerman To: Greg Kroah-Hartman , Nayna Cc: Nayna Jain , linuxppc-dev@ozlabs.org, linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Ard Biesheuvel , Jeremy Kerr , Matthew Garret , Mimi Zohar , Claudio Carvalho , George Wilson , Elaine Palmer , Eric Ricther , Oliver O'Halloran Subject: Re: [PATCH] sysfs: add BIN_ATTR_WO() macro In-Reply-To: <20190826150153.GD18418@kroah.com> References: <1566825818-9731-1-git-send-email-nayna@linux.ibm.com> <1566825818-9731-3-git-send-email-nayna@linux.ibm.com> <20190826140131.GA15270@kroah.com> <20190826150153.GD18418@kroah.com> Date: Tue, 03 Sep 2019 13:37:02 +1000 Message-ID: <87ef0yrqxt.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Greg Kroah-Hartman writes: > This variant was missing from sysfs.h, I guess no one noticed it before. > > Turns out the powerpc secure variable code can use it, so add it to the > tree for it, and potentially others to take advantage of, instead of > open-coding it. > > Reported-by: Nayna Jain > Signed-off-by: Greg Kroah-Hartman > --- > > I'll queue this up to my tree for 5.4-rc1, but if you want to take this > in your tree earlier, feel free to do so. OK. This series is blocked on the firmware support going in, so at the moment it might miss v5.4 anyway. So this going via your tree is no problem. If it does make it into v5.4 we can do a fixup patch to use the new macro once everything's in Linus' tree. cheers > diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h > index 965236795750..5420817ed317 100644 > --- a/include/linux/sysfs.h > +++ b/include/linux/sysfs.h > @@ -196,6 +196,12 @@ struct bin_attribute { > .size = _size, \ > } > > +#define __BIN_ATTR_WO(_name) { \ > + .attr = { .name = __stringify(_name), .mode = 0200 }, \ > + .store = _name##_store, \ > + .size = _size, \ > +} > + > #define __BIN_ATTR_RW(_name, _size) \ > __BIN_ATTR(_name, 0644, _name##_read, _name##_write, _size) > > @@ -208,6 +214,9 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR(_name, _mode, _read, \ > #define BIN_ATTR_RO(_name, _size) \ > struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size) > > +#define BIN_ATTR_WO(_name, _size) \ > +struct bin_attribute bin_attr_##_name = __BIN_ATTR_WO(_name, _size) > + > #define BIN_ATTR_RW(_name, _size) \ > struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) > > -- > 2.23.0