From: Haoyu Lu <hechushiguitu666@gmail.com>
To: Michael Hennerich <michael.hennerich@analog.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org,
"haoyu.lu" <hechushiguitu666@gmail.com>
Subject: [PATCH] misc: ad525x_dpot: fix macro parentheses and permissions
Date: Thu, 26 Mar 2026 16:55:10 +0800 [thread overview]
Message-ID: <20260326085514.14505-1-hechushiguitu666@gmail.com> (raw)
From: "haoyu.lu" <hechushiguitu666@gmail.com>
Fix checkpatch.pl warnings:
- Macros with complex values should be enclosed in parentheses
- Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred
Signed-off-by: haoyu.lu <hechushiguitu666@gmail.com>
---
drivers/misc/ad525x_dpot.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c
index 57bead9fba1b..ee258cd325f6 100644
--- a/drivers/misc/ad525x_dpot.c
+++ b/drivers/misc/ad525x_dpot.c
@@ -511,14 +511,16 @@ set_##_name(struct device *dev, \
return sysfs_set_reg(dev, attr, buf, count, _reg); \
}
-#define DPOT_DEVICE_SHOW_SET(name, reg) \
+#define DPOT_DEVICE_SHOW_SET(name, reg) ( \
DPOT_DEVICE_SHOW(name, reg) \
DPOT_DEVICE_SET(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, set_##name)
+static DEVICE_ATTR(name, 0644, show_##name, set_##name) \
+)
-#define DPOT_DEVICE_SHOW_ONLY(name, reg) \
+#define DPOT_DEVICE_SHOW_ONLY(name, reg) ( \
DPOT_DEVICE_SHOW(name, reg) \
-static DEVICE_ATTR(name, S_IWUSR | S_IRUGO, show_##name, NULL)
+static DEVICE_ATTR(name, 0644, show_##name, NULL) \
+)
DPOT_DEVICE_SHOW_SET(rdac0, DPOT_ADDR_RDAC | DPOT_RDAC0);
DPOT_DEVICE_SHOW_SET(eeprom0, DPOT_ADDR_EEPROM | DPOT_RDAC0);
@@ -615,7 +617,7 @@ set_##_name(struct device *dev, \
{ \
return sysfs_do_cmd(dev, attr, buf, count, _cmd); \
} \
-static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, NULL, set_##_name)
+static DEVICE_ATTR(_name, 0644, NULL, set_##_name)
DPOT_DEVICE_DO_CMD(inc_all, DPOT_INC_ALL);
DPOT_DEVICE_DO_CMD(dec_all, DPOT_DEC_ALL);
--
2.53.0.windows.1
next reply other threads:[~2026-03-26 8:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 8:55 Haoyu Lu [this message]
2026-03-26 9:04 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260326085514.14505-1-hechushiguitu666@gmail.com \
--to=hechushiguitu666@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®