All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 04/12] hwmon: (mc13783-adc) Increase size of name string
@ 2013-09-14  8:33 Guenter Roeck
  2013-09-14 18:00 ` Jean Delvare
  2013-09-14 19:33 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2013-09-14  8:33 UTC (permalink / raw)
  To: lm-sensors

smatch complains about

mc13783_adc_probe() error: snprintf() chops off the last chars of
'id->name': 20 +vs 10

Use PLATFORM_NAME_SIZE instead of '10' as size when declaring
the name variable.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/hwmon/mc13783-adc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
index 982d862..ae00e60 100644
--- a/drivers/hwmon/mc13783-adc.c
+++ b/drivers/hwmon/mc13783-adc.c
@@ -37,7 +37,7 @@
 struct mc13783_adc_priv {
 	struct mc13xxx *mc13xxx;
 	struct device *hwmon_dev;
-	char name[10];
+	char name[PLATFORM_NAME_SIZE];
 };
 
 static ssize_t mc13783_adc_show_name(struct device *dev, struct device_attribute
-- 
1.7.9.7


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

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

end of thread, other threads:[~2013-09-14 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-14  8:33 [lm-sensors] [PATCH 04/12] hwmon: (mc13783-adc) Increase size of name string Guenter Roeck
2013-09-14 18:00 ` Jean Delvare
2013-09-14 19:33 ` 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.