* [PATCH] misc: ad525x_dpot: fix macro parentheses and permissions
@ 2026-03-26 8:55 Haoyu Lu
2026-03-26 9:04 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Haoyu Lu @ 2026-03-26 8:55 UTC (permalink / raw)
To: Michael Hennerich
Cc: Greg Kroah-Hartman, Arnd Bergmann, linux-kernel, haoyu.lu
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] misc: ad525x_dpot: fix macro parentheses and permissions
2026-03-26 8:55 [PATCH] misc: ad525x_dpot: fix macro parentheses and permissions Haoyu Lu
@ 2026-03-26 9:04 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-03-26 9:04 UTC (permalink / raw)
To: Haoyu Lu; +Cc: Michael Hennerich, Arnd Bergmann, linux-kernel
On Thu, Mar 26, 2026 at 04:55:10PM +0800, Haoyu Lu wrote:
> 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>
Please do not do checkpatch cleanups in other areas of the kernel when
you do not have the experience of doing them first in drivers/staging/
as due to a number of problems in this patch, it obviously can not be
applied :(
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-26 9:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-26 8:55 [PATCH] misc: ad525x_dpot: fix macro parentheses and permissions Haoyu Lu
2026-03-26 9:04 ` Greg Kroah-Hartman
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®