* [PATCH net-next] net/9p: use DEVICE_ATTR_RO macro
@ 2021-05-19 2:56 YueHaibing
2021-05-19 3:26 ` asmadeus
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-05-19 2:56 UTC (permalink / raw)
To: ericvh, lucho, asmadeus, davem, kuba
Cc: v9fs-developer, netdev, 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>
---
net/9p/trans_virtio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 93f2f8654882..43339f314a86 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -528,8 +528,8 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
return err;
}
-static ssize_t p9_mount_tag_show(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t mount_tag_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct virtio_chan *chan;
struct virtio_device *vdev;
@@ -544,7 +544,7 @@ static ssize_t p9_mount_tag_show(struct device *dev,
return tag_len + 1;
}
-static DEVICE_ATTR(mount_tag, 0444, p9_mount_tag_show, NULL);
+static DEVICE_ATTR_RO(mount_tag);
/**
* p9_virtio_probe - probe for existence of 9P virtio channels
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/9p: use DEVICE_ATTR_RO macro
2021-05-19 2:56 [PATCH net-next] net/9p: use DEVICE_ATTR_RO macro YueHaibing
@ 2021-05-19 3:26 ` asmadeus
0 siblings, 0 replies; 2+ messages in thread
From: asmadeus @ 2021-05-19 3:26 UTC (permalink / raw)
To: YueHaibing
Cc: ericvh, lucho, davem, kuba, v9fs-developer, netdev, linux-kernel
YueHaibing wrote on Wed, May 19, 2021 at 10:56:39AM +0800:
> 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>
Sure, why not.
Will queue to -next tomorrow-ish
--
Dominique
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-19 3:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19 2:56 [PATCH net-next] net/9p: use DEVICE_ATTR_RO macro YueHaibing
2021-05-19 3:26 ` asmadeus
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).