Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1703349pxp; Mon, 7 Mar 2022 00:00:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLfmmgmdHRaml22lNTwRFj/H6s9YDHcvxJ45XT8o5+LaxEuPJ+Vu90gMlwekJwcgtY+Xq5 X-Received: by 2002:a17:902:9690:b0:14f:fc09:fd02 with SMTP id n16-20020a170902969000b0014ffc09fd02mr10517872plp.66.1646640059164; Mon, 07 Mar 2022 00:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646640059; cv=none; d=google.com; s=arc-20160816; b=wDqmDenCwBh+/YBg0fIqx4+ers34XP98UjMvVt7LifB5i4erAu74uXppfQByjPWq6/ Eba036t86Tyo+2eu8gZXQJFM0BePbszDDyURJNo6df88WQBdrm1e6GR7bDbKBIg7WhbC Q/csLCqSUW3ooKw00NtaTKn/MvX1NxPIyXS4Ggm+yntNAkJEYRY3KIuBDSmY2jC8uZfB NFmLUpX47A+57109hQIGFdwX1YHGM+BSU9FAQOSNQlyTC8QRGRTExh/2/ZvRPlnOPPHp ROIgeAIuZUx+ejvVqNBIi7w+8nPvhBZI4+v4/AhPjXMr/4fhwlkeMFzYSmxrhtzNfOgX XU1g== 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=Mk18g2RY+1zwIxb1YGwk6BhfHK0rEyFwIPe3IqmXMWw=; b=vrzWgfMTvbsy5CurwUzvDnTgqCSDSWARIPR5VD9YkfjAvFJyDGpMDmc5LVULF9Aae/ m6LPBSUreV8g6oyP8AeNm4CnlG1aQPvx98wL8zmTlePBXK+QNdvKM57iCGUGM0f8BTJp if8nnSuQoS9mYV7GiciET1xmnmZXKsIvm/VhNTAMxqbT7lPRtSfB0m7HpyCE/qDW5kRU jtDuQtMviugG/D1/oVpiwRE9LaUoe0Yc2i+4VjZaN9helXqngO4/jfjBdKJ5HBGFN/Zp zt79dkJg6mrVxtncQDYlN5+59BuE0GQYhT6b96s7MNknNvIZwL5ihyMzdKFvKt9GNc+7 Og9Q== 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 ng16-20020a17090b1a9000b001bf6715212dsi168386pjb.104.2022.03.07.00.00.42; Mon, 07 Mar 2022 00:00:58 -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 S234616AbiCGBfO (ORCPT + 99 others); Sun, 6 Mar 2022 20:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234605AbiCGBfM (ORCPT ); Sun, 6 Mar 2022 20:35:12 -0500 Received: from smtpproxy21.qq.com (smtpbg701.qq.com [203.205.195.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F292B1E3C1 for ; Sun, 6 Mar 2022 17:34:16 -0800 (PST) X-QQ-mid: bizesmtp80t1646616832two2455y Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 07 Mar 2022 09:33:45 +0800 (CST) X-QQ-SSF: 01400000002000B0I000B00A0000000 X-QQ-FEAT: YOzQJqMlvs4f0p3oV5qekI6gjmv0OXoUKubEtLBd7DsMVpP17aR3kyW0ldIiv EaXKoETMz0yDDbOfcuL5ONVBej/MrqqUkMx+snT2lnNT1GNWTWwSWyhbf/bNWDRQUzAnSAz NKfbCl8f5BkJDysjcPDz3z3BaTwO1a7xs7YEreEH3Ai5z3UmH0RfQbe69GaksQGLAUWwPOV ik1a9pnAACPQqSTKaOEm83NtFT4oXcz5s257yfeVncijvF/Zmd32gSR+qGgkdPTVfAuNtSq kot46+3u7HDH5cltLJCII71188gG/zd4Ipl0iGV3+4bDR/dzClfxHdaKeOffRBaM1tKVjUA mxRSKuFsF0Cm4ly+VW0ITr0Anx17w328Ah6ZFNBW8d6Ki24j7g= X-QQ-GoodBg: 2 From: Lianjie Zhang To: Jakub Kicinski Cc: "David S. Miller" , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, zhanglianjie , Jay Vosburgh Subject: [PATCH v2] bonding: helper macro __ATTR_RO to make code more clear Date: Mon, 7 Mar 2022 09:33:33 +0800 Message-Id: <20220307013333.15826-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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 From: zhanglianjie Delete SLAVE_ATTR macro, use __ATTR_RO replacement, make code logic clearer and unified. Signed-off-by: Lianjie Zhang Reviewed-by: Jay Vosburgh 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