Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp946775pxp; Sun, 6 Mar 2022 01:37:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIesJGYiQWA0VksfT3FNcfpWEdbhh56FgF6YPfB2l9EoCy/+aVegmHOCxjCrTxBnDpHAI4 X-Received: by 2002:a17:906:a4b:b0:6d0:fbdd:7cb5 with SMTP id x11-20020a1709060a4b00b006d0fbdd7cb5mr5289830ejf.152.1646559458380; Sun, 06 Mar 2022 01:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646559458; cv=none; d=google.com; s=arc-20160816; b=yDCZKQMqiMHd84XMJt1ScrJ/na+JliSh/hNS/qzRPDfHCYAUmnk7viXlzv/W9r3kbT a94sESBlvPVN+p7vDpeY09BGdtxnCeOKEgvG3Wulzvk14R2Ag5n2ftzihC4wDEMIcB+U BWy/Y09R2Q82P7sPe9X3+btPBgX0SHOhF3efN1A1KEAX43jQiDpqLvBgv37hH35C17Xd vVsSYWuywBbxPQj6RfZAOAod52/DL2mkJI6DlGqMh5Rrv09kI3RwjsEIdALVUpkNYJf5 l4JeCepQ61Zqe1Qyk0JdxA3a1rgmItStPQ7TASyENkx1RpZuuC4C93D2DQgll85Hy0Jd PFpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=MaonR+A6xiUfNRrDy7LJstYzMZfD/D30ZuXXH9hOjMA=; b=wSSu9lYOAkCQ0Iuh5xj8R80u6ZYKXThl9swxymYzf33dPg7cU+wSeLNy8pYfMmECW7 iHySIeZbGovYkfEK4W1SjHpYzmIw+nHUx2VL2VRZFY1wLu+jMy/ITKixJxPfCL10azXn yffwt67ogfe+4PpbRs47PYjDNlPlKr17eJbAzNCFz02AJ0OSHyYSUwcWlmKfBEVxZ7dM NJPzuSDbALInf+mSEquzrP9Xx+F8FqgLl15watIP4MptOLZlaqmMdjkieggn1NNSXCmj rb0qEmIbR8/5ClweQU2SGHK2nQvdVtNKB9p4Z1yDWOar0MRGPosudfyuhxfe5GvtIyrw Dt4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a170906785400b006cd430acba6si6113530ejm.61.2022.03.06.01.36.50; Sun, 06 Mar 2022 01:37:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbiCFI3v (ORCPT + 99 others); Sun, 6 Mar 2022 03:29:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232586AbiCFI3v (ORCPT ); Sun, 6 Mar 2022 03:29:51 -0500 Received: from smtpbg501.qq.com (smtpbg501.qq.com [203.205.250.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBDEB3FBF1 for ; Sun, 6 Mar 2022 00:28:55 -0800 (PST) X-QQ-mid: bizesmtp70t1646555298tpc46is0 Received: from localhost.localdomain ( [114.222.120.105]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 06 Mar 2022 16:28:10 +0800 (CST) X-QQ-SSF: 01400000002000B0I000C00A0000000 X-QQ-FEAT: qRSZ1HlaXGByGca36I+bIIq76RHZ8CQngWUNAw/6zayHFsrox5oEIx274EzHu opQ/Wl/Ui53PubUtStOlaI5Uq1yLpQS2H70ssqkc2PDYbFW3qu2IGW4ali+qLNTwkEsAWKC 04pIBKEm4AUOpQMEjlfUwk/LXajyXBwWlq10k1cXxyFetq/gTEBQYbK41/tKTf/+8GrFPXO fnWX5tqPb7g0603XwTgEKHb80Z378teBmb14PFQ8dXRk4neRHLa3rR9ZO6XwEyfv2jWLARO zG+wJW7TM5HRXxNDw5yBU2daTyIYWuCIh2c5mr3S1Em/rqpOrCBUArZIalmVB4Q57fpeLIh 0iGSPIL2RZJZnDEl6ldB7pCYXm7NbbdaqURaOf36nsmVoMkB0k= X-QQ-GoodBg: 2 From: Lianjie Zhang To: Jakub Kicinski Cc: "David S. Miller" , Jay Vosburgh , Veaceslav Falico , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lianjie Zhang Subject: [PATCH] bonding: helper macro __ATTR_RO to make code more clear Date: Sun, 6 Mar 2022 16:28:08 +0800 Message-Id: <20220306082808.85844-1-zhanglianjie@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign6 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_HELO_TEMPERROR autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Lianjie Zhang diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 6a6cdd0bb258..69b0a3751dff 100644 --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c @@ -15,14 +15,8 @@ struct slave_attribute { ssize_t (*show)(struct slave *, char *); }; -#define SLAVE_ATTR(_name, _mode, _show) \ -const struct slave_attribute slave_attr_##_name = { \ - .attr = {.name = __stringify(_name), \ - .mode = _mode }, \ - .show = _show, \ -}; #define SLAVE_ATTR_RO(_name) \ - SLAVE_ATTR(_name, 0444, _name##_show) +const struct slave_attribute slave_attr_##_name = __ATTR_RO(_name) static ssize_t state_show(struct slave *slave, char *buf) { -- 2.20.1