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>] [day] [month] [year] [list]
Date:   Wed, 2 Jun 2021 10:17:16 +0800
From:   Zhen Lei <thunder.leizhen@...wei.com>
To:     Sam Ravnborg <sam@...nborg.org>,
        Jani Nikula <jani.nikula@...el.com>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        linux-fbdev <linux-fbdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
CC:     Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH 1/1] video: fbdev: w100fb: use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO macro helper instead of plain DEVICE_ATTR, which makes
the code a bit shorter and easier to read.

Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
 drivers/video/fbdev/w100fb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c
index d96ab28f8ce4ae5..64a5e048c13f76a 100644
--- a/drivers/video/fbdev/w100fb.c
+++ b/drivers/video/fbdev/w100fb.c
@@ -108,7 +108,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con
 
 static DEVICE_ATTR_RW(flip);
 
-static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+static ssize_t reg_read_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	unsigned long regs, param;
 	regs = simple_strtoul(buf, NULL, 16);
@@ -117,9 +117,9 @@ static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr
 	return count;
 }
 
-static DEVICE_ATTR(reg_read, 0200, NULL, w100fb_reg_read);
+static DEVICE_ATTR_WO(reg_read);
 
-static ssize_t w100fb_reg_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+static ssize_t reg_write_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
 	unsigned long regs, param;
 	sscanf(buf, "%lx %lx", &regs, &param);
@@ -132,7 +132,7 @@ static ssize_t w100fb_reg_write(struct device *dev, struct device_attribute *att
 	return count;
 }
 
-static DEVICE_ATTR(reg_write, 0200, NULL, w100fb_reg_write);
+static DEVICE_ATTR_WO(reg_write);
 
 
 static ssize_t fastpllclk_show(struct device *dev, struct device_attribute *attr, char *buf)
-- 
2.26.0.106.g9fadedd


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ