All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhen Lei <thunder.leizhen@huawei.com>
To: Matt Porter <mporter@kernel.crashing.org>,
	Alexandre Bounine <alex.bou9@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH 1/1] rapidio: use DEVICE_ATTR_RO macro
Date: Wed, 2 Jun 2021 15:52:29 +0800	[thread overview]
Message-ID: <20210602075229.11064-1-thunder.leizhen@huawei.com> (raw)

Use DEVICE_ATTR_RO macro helper instead of plain DEVICE_ATTR, which makes
the code a bit shorter and easier to read.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/rapidio/switches/idt_gen2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rapidio/switches/idt_gen2.c b/drivers/rapidio/switches/idt_gen2.c
index 8a89bba17d39900..0fb91e6c691f456 100644
--- a/drivers/rapidio/switches/idt_gen2.c
+++ b/drivers/rapidio/switches/idt_gen2.c
@@ -366,7 +366,7 @@ idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
 }
 
 static ssize_t
-idtg2_show_errlog(struct device *dev, struct device_attribute *attr, char *buf)
+errlog_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct rio_dev *rdev = to_rio_dev(dev);
 	ssize_t len = 0;
@@ -384,7 +384,7 @@ idtg2_show_errlog(struct device *dev, struct device_attribute *attr, char *buf)
 	return len;
 }
 
-static DEVICE_ATTR(errlog, S_IRUGO, idtg2_show_errlog, NULL);
+static DEVICE_ATTR_RO(errlog);
 
 static int idtg2_sysfs(struct rio_dev *rdev, bool create)
 {
-- 
2.26.0.106.g9fadedd



                 reply	other threads:[~2021-06-02  7:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210602075229.11064-1-thunder.leizhen@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=alex.bou9@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mporter@kernel.crashing.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.