All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix checkpatch
@ 2012-01-08 18:34 Frans Meulenbroeks
  2012-01-08 18:55 ` [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Frans Meulenbroeks @ 2012-01-08 18:34 UTC (permalink / raw)
  To: lm-sensors

fixed:
WARNING: static const char * array should probably be static const char * const
#43: FILE: wm831x-hwmon.c:43:
+static const char *input_names[] = {

not fixed (will probably provide separate fix later)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#98: FILE: wm831x-hwmon.c:98:
+#define WM831X_NAMED_VOLTAGE(id, name) \
+	WM831X_VOLTAGE(id, name); \
+	static SENSOR_DEVICE_ATTR(in##id##_label, S_IRUGO, show_label,	\
+				  NULL, name)

total: 1 errors, 1 warnings, 217 lines checked

wm831x-hwmon.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
---
 drivers/hwmon/wm831x-hwmon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/wm831x-hwmon.c b/drivers/hwmon/wm831x-hwmon.c
index 9b598ed..23b44de 100644
--- a/drivers/hwmon/wm831x-hwmon.c
+++ b/drivers/hwmon/wm831x-hwmon.c
@@ -40,7 +40,7 @@ static ssize_t show_name(struct device *dev,
 	return sprintf(buf, "wm831x\n");
 }
 
-static const char *input_names[] = {
+static const char * const input_names[] = {
 	[WM831X_AUX_SYSVDD]    = "SYSVDD",
 	[WM831X_AUX_USB]       = "USB",
 	[WM831X_AUX_BKUP_BATT] = "Backup battery",
-- 
1.7.8.2


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix
  2012-01-08 18:34 [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix checkpatch Frans Meulenbroeks
@ 2012-01-08 18:55 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2012-01-08 18:55 UTC (permalink / raw)
  To: lm-sensors

On Sun, Jan 08, 2012 at 01:34:19PM -0500, Frans Meulenbroeks wrote:
> fixed:
> WARNING: static const char * array should probably be static const char * const
> #43: FILE: wm831x-hwmon.c:43:
> +static const char *input_names[] = {
> 
> not fixed (will probably provide separate fix later)
> ERROR: Macros with multiple statements should be enclosed in a do - while loop
> #98: FILE: wm831x-hwmon.c:98:
> +#define WM831X_NAMED_VOLTAGE(id, name) \
> +	WM831X_VOLTAGE(id, name); \
> +	static SENSOR_DEVICE_ATTR(in##id##_label, S_IRUGO, show_label,	\
> +				  NULL, name)
> 
This is really a false positive, or at least one that can not be fixed by enclosing it
in a while loop, since the macro does not define a sequence of operations.

While I don't like the style much, not sure how to fix a problem like this except by
unwinding the macro - and that might end up being a bit clumsy.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-08 18:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-08 18:34 [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix checkpatch Frans Meulenbroeks
2012-01-08 18:55 ` [lm-sensors] [PATCH 16/17 v2] hwmon: (wm831x-hwmon) fix Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.