From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Lianjie Zhang <zhanglianjie@uniontech.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] bonding: helper macro __ATTR_RO to make code more clear
Date: Tue, 08 Mar 2022 13:25:27 -0800 [thread overview]
Message-ID: <2941.1646774727@famine> (raw)
In-Reply-To: <20220307013333.15826-1-zhanglianjie@uniontech.com>
Lianjie Zhang <zhanglianjie@uniontech.com> wrote:
>From: zhanglianjie <zhanglianjie@uniontech.com>
>
>Delete SLAVE_ATTR macro, use __ATTR_RO replacement,
>make code logic clearer and unified.
>
>Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>
>Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Please do not add tags that individuals do not explicitly
provide.
Other than the above, the change seems fine.
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
-J
>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
---
-Jay Vosburgh, jay.vosburgh@canonical.com
prev parent reply other threads:[~2022-03-08 21:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 1:33 [PATCH v2] bonding: helper macro __ATTR_RO to make code more clear Lianjie Zhang
2022-03-08 21:25 ` Jay Vosburgh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2941.1646774727@famine \
--to=jay.vosburgh@canonical.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@gmail.com \
--cc=zhanglianjie@uniontech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).