hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements
Guenter Roeck
maintainerPATCH v2 1/5 hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure elements
twl4030_madc_conversion uses do_avg and type structure elements of twl4030_madc_request. Initialize structure to avoid random operation.
---
v2: review feedback - initialize twl4030_madc_request structure in declaration.
With this change, I think this patch is a candidate for 3.6 and -stable.
drivers/hwmon/twl4030-madc-hwmon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/hwmon/twl4030-madc-hwmon.c +5 -4
@@ -44,12 +44,13 @@ static ssize_t madc_read(struct device *dev, struct device_attribute *devattr, char *buf) { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -struct twl4030_madc_request req; +struct twl4030_madc_request req = { + .channels =1 << attr->index, + .method =TWL4030_MADC_SW2 , + .type =TWL4030_MADC_WAIT , + };long val; - req.channels = (1 << attr->index); - req.method =TWL4030_MADC_SW2 ; - req.func_cb =NULL ; val =twl4030_madc_conversion (&req);if (val <0 )return val;
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2 1/5] hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure eleme
Quoted 5 lines · Guenter Roeck
twl4030_madc_conversionusesdo_avgand type structure elements oftwl4030_madc_request. Initialize structure to avoid random operation.Cc Keerthy <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Quoted 29 lines
---
v2: review feedback - initializetwl4030_madc_requeststructure in declaration.
With this change, I think this patch is a candidate for 3.6 and -stable.drivers/hwmon/twl4030-madc-hwmon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/hwmon/twl4030-madc-hwmon.c +5
-4@@ -44,12 +44,13 @@ static ssize_t madc_read(struct device *dev, struct device_attribute *devattr, char *buf) { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -struct twl4030_madc_request req; +struct twl4030_madc_request req = { + .channels =1 << attr->index, + .method =TWL4030_MADC_SW2 , + .type =TWL4030_MADC_WAIT , + };long val; - req.channels = (1 << attr->index); - req.method =TWL4030_MADC_SW2 ; - req.func_cb =NULL ; val =twl4030_madc_conversion (&req);if (val <0 )return val;
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v2 1/5] hwmon: (twl4030-madc-hwmon) Initialize uninitialized structure eleme
In reply to Guenter RoeckQuoted 8 lines · Jean Delvare
Quoted 5 lines · Guenter Roeck
twl4030_madc_conversionusesdo_avgand type structure elements oftwl4030_madc_request. Initialize structure to avoid random operation.Cc Keerthy <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
Quoted 40 lines
Acked-by Keerthy <[email protected]>Quoted 2 lines
---
v2: review feedback - initializetwl4030_madc_requeststructure indeclaration.
Quoted 1 line
With this change, I think this patch is a candidate for 3.6 and
-stable.
Review
Quoted 5 lines
drivers/hwmon/twl4030-madc-hwmon.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/hwmon/twl4030-madc-hwmon.cQuoted 11 lines
index 0018c7d..1a174f0 100644
drivers/hwmon/twl4030-madc-hwmon.c +3
-1@@ -44,12 +44,13 @@ static ssize_t madc_read(struct device *dev, struct device_attribute *devattr, char *buf) { struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -struct twl4030_madc_request req; + struct twl4030_madc_request req = { + .channels = 1 << attr->index, + .method = TWL4030_MADC_SW2,drivers/hwmon/twl4030-madc-hwmon.c static ssize_t madc_read(struct device *dev, · line 56
Quoted 10 lines
drivers/hwmon/twl4030-madc-hwmon.c +2
-3+ .type = TWL4030_MADC_WAIT, + };long val; - req.channels = (1 << attr->index); - req.method =TWL4030_MADC_SW2 ; - req.func_cb =NULL ; val =twl4030_madc_conversion (&req);if (val <0 )return val;--
Jean Delvare
Signature · 2 lines
Regards and Thanks, Keerthy
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors