public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] hwmon: (mc13xxx-adc) make name buffer larger
@ 2012-02-01 14:42 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-02-01 14:42 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Guenter Roeck, lm-sensors, linux-kernel, kernel-janitors

This is doesn't change how the code works, it's just a thing to make the
static checkers happy.  We transfer a 12 character string from a 20
character buffer to a 10 character buffer using snprintf().  The static
checkers complain that that lops off the last couple characters.

The static checkers are right, but it turns out we don't care because
later on we truncate the name at the '-' character.  Oh well, let's
change it so they don't complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
index e9a7659d..282aaf5 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-01 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 14:42 [patch] hwmon: (mc13xxx-adc) make name buffer larger Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox