netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bonding: helper macro __ATTR_RO to make code more clear
Date: Sun, 06 Mar 2022 10:30:50 -0800	[thread overview]
Message-ID: <24908.1646591450@famine> (raw)
In-Reply-To: <20220306082808.85844-1-zhanglianjie@uniontech.com>

Lianjie Zhang <zhanglianjie@uniontech.com> wrote:

>Signed-off-by: Lianjie Zhang <zhanglianjie@uniontech.com>

	I'm ok with the change, but this needs a sentence or two in the
commit log message to explain what's going on, so that future readers of
the log don't have to read the diff to figure out why this change makes
sense.

	-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

      reply	other threads:[~2022-03-06 18:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-06  8:28 [PATCH] bonding: helper macro __ATTR_RO to make code more clear Lianjie Zhang
2022-03-06 18:30 ` 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=24908.1646591450@famine \
    --to=jay.vosburgh@canonical.com \
    --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).