lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210519025639.12108-1-yuehaibing@huawei.com>
Date:   Wed, 19 May 2021 10:56:39 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <ericvh@...il.com>, <lucho@...kov.net>, <asmadeus@...ewreck.org>,
        <davem@...emloft.net>, <kuba@...nel.org>
CC:     <v9fs-developer@...ts.sourceforge.net>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH net-next] net/9p: use DEVICE_ATTR_RO macro

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ