projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4c1ab0
)
mm/dmapool: use DEVICE_ATTR_RO macro
author
YueHaibing
<yuehaibing@huawei.com>
Tue, 29 Jun 2021 02:40:05 +0000
(19:40 -0700)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Tue, 29 Jun 2021 17:53:52 +0000
(10:53 -0700)
Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(), which makes
the code a bit shorter and easier to read.
Link:
https://lkml.kernel.org/r/20210524112852.34716-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/dmapool.c
patch
|
blob
|
blame
|
history
diff --git
a/mm/dmapool.c
b/mm/dmapool.c
index 16483f86360e1c92de2ecf37c1808ee392de913b..64b537b3ccb06ded3bd2cf6cb643ced6ac1be6dc 100644
(file)
--- a/
mm/dmapool.c
+++ b/
mm/dmapool.c
@@
-62,8
+62,7
@@
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
+102,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.