From: YueHaibing <yuehaibing@huawei.com>
To: <akpm@linux-foundation.org>, <andriy.shevchenko@linux.intel.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] mm/dmapool: use DEVICE_ATTR_RO macro
Date: Sun, 23 May 2021 14:46:26 +0800 [thread overview]
Message-ID: <20210523064626.41532-1-yuehaibing@huawei.com> (raw)
Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
mm/dmapool.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/dmapool.c b/mm/dmapool.c
index 16483f86360e..62083ef04878 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -62,8 +62,8 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
static DEFINE_MUTEX(pools_lock);
static DEFINE_MUTEX(pools_reg_lock);
-static ssize_t
-show_pools(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t pools_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
unsigned temp;
unsigned size;
@@ -103,7 +103,7 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf)
return PAGE_SIZE - size;
}
-static DEVICE_ATTR(pools, 0444, show_pools, NULL);
+static DEVICE_ATTR_RO(pools);
/**
* dma_pool_create - Creates a pool of consistent memory blocks, for dma.
--
2.17.1
next reply other threads:[~2021-05-23 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-23 6:46 YueHaibing [this message]
2021-05-24 10:45 ` Andy Shevchenko
2021-05-24 11:25 ` YueHaibing
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=20210523064626.41532-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox