linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] RDMA/core: use DEVICE_ATTR_RO macro
@ 2021-05-26 13:29 YueHaibing
  2021-05-28 23:42 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-05-26 13:29 UTC (permalink / raw)
  To: dledford, jgg, leon; +Cc: linux-rdma, linux-kernel, YueHaibing

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>
---
 drivers/infiniband/core/ucma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 1f198c180aa1..74144e513dc7 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1830,13 +1830,13 @@ static struct ib_client rdma_cma_client = {
 };
 MODULE_ALIAS_RDMA_CLIENT("rdma_cm");
 
-static ssize_t show_abi_version(struct device *dev,
+static ssize_t abi_version_show(struct device *dev,
 				struct device_attribute *attr,
 				char *buf)
 {
 	return sysfs_emit(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
 }
-static DEVICE_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+static DEVICE_ATTR_RO(abi_version);
 
 static int __init ucma_init(void)
 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] RDMA/core: use DEVICE_ATTR_RO macro
  2021-05-26 13:29 [PATCH -next] RDMA/core: use DEVICE_ATTR_RO macro YueHaibing
@ 2021-05-28 23:42 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2021-05-28 23:42 UTC (permalink / raw)
  To: YueHaibing; +Cc: dledford, leon, linux-rdma, linux-kernel

On Wed, May 26, 2021 at 09:29:49PM +0800, YueHaibing wrote:
> 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>
> ---
>  drivers/infiniband/core/ucma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-next, also touched with clang-format

Thanks,
Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-28 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 13:29 [PATCH -next] RDMA/core: use DEVICE_ATTR_RO macro YueHaibing
2021-05-28 23:42 ` Jason Gunthorpe

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).