All of lore.kernel.org
 help / color / mirror / Atom feed
* STMicroelectronics st_sensors fixed warning messages
@ 2013-02-26 10:43 Denis CIOCCA
  2013-02-26 10:43 ` [PATCH] iio:common: fixed all warning messages about uninitialized variables Denis CIOCCA
  2013-02-26 16:14 ` STMicroelectronics st_sensors fixed warning messages Jonathan Cameron
  0 siblings, 2 replies; 5+ messages in thread
From: Denis CIOCCA @ 2013-02-26 10:43 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, fengguang.wu

Hi Jonathan,

as reported by Fengguang Wu, I send to you the patch to fix the warning messages.
Thanks,

Denis
 

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

* [PATCH] iio:common: fixed all warning messages about uninitialized variables
  2013-02-26 10:43 STMicroelectronics st_sensors fixed warning messages Denis CIOCCA
@ 2013-02-26 10:43 ` Denis CIOCCA
  2013-02-26 16:14 ` STMicroelectronics st_sensors fixed warning messages Jonathan Cameron
  1 sibling, 0 replies; 5+ messages in thread
From: Denis CIOCCA @ 2013-02-26 10:43 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, fengguang.wu, Denis Ciocca

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
---
 drivers/iio/common/st_sensors/st_sensors_core.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 0198324..bd33473 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -62,7 +62,7 @@ st_sensors_match_odr_error:
 int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
 {
 	int err;
-	struct st_sensor_odr_avl odr_out;
+	struct st_sensor_odr_avl odr_out = {0, 0};
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
 	err = st_sensors_match_odr(sdata->sensor, odr, &odr_out);
@@ -114,7 +114,7 @@ st_sensors_match_odr_error:
 
 static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
 {
-	int err, i;
+	int err, i = 0;
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
 	err = st_sensors_match_fs(sdata->sensor, fs, &i);
@@ -139,14 +139,13 @@ st_accel_set_fullscale_error:
 
 int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable)
 {
-	bool found;
 	u8 tmp_value;
 	int err = -EINVAL;
-	struct st_sensor_odr_avl odr_out;
+	bool found = false;
+	struct st_sensor_odr_avl odr_out = {0, 0};
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
 	if (enable) {
-		found = false;
 		tmp_value = sdata->sensor->pw.value_on;
 		if ((sdata->sensor->odr.addr == sdata->sensor->pw.addr) &&
 			(sdata->sensor->odr.mask == sdata->sensor->pw.mask)) {
-- 
1.7.9.5


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

* Re: STMicroelectronics st_sensors fixed warning messages
  2013-02-26 10:43 STMicroelectronics st_sensors fixed warning messages Denis CIOCCA
  2013-02-26 10:43 ` [PATCH] iio:common: fixed all warning messages about uninitialized variables Denis CIOCCA
@ 2013-02-26 16:14 ` Jonathan Cameron
  2013-02-26 16:19   ` Denis CIOCCA
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2013-02-26 16:14 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: jic23, linux-iio, fengguang.wu

On 26/02/13 10:43, Denis CIOCCA wrote:
> Hi Jonathan,
>
> as reported by Fengguang Wu, I send to you the patch to fix the warning messages.
> Thanks,
>
> Denis
>
>
IIRC this is a false positive warning?

I'll take the patch either way, but if it's a false positive
I'll queue it for the next cycle rather than send it on as
a fix for this one.

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

* Re: STMicroelectronics st_sensors fixed warning messages
  2013-02-26 16:14 ` STMicroelectronics st_sensors fixed warning messages Jonathan Cameron
@ 2013-02-26 16:19   ` Denis CIOCCA
  2013-03-02 16:38     ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Denis CIOCCA @ 2013-02-26 16:19 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: jic23, linux-iio, fengguang.wu

> IIRC this is a false positive warning?
Yeah, only false positive warning.


> I'll take the patch either way, but if it's a false positive
> I'll queue it for the next cycle rather than send it on as
> a fix for this one.
>
Thanks,

Denis

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

* Re: STMicroelectronics st_sensors fixed warning messages
  2013-02-26 16:19   ` Denis CIOCCA
@ 2013-03-02 16:38     ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2013-03-02 16:38 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: Jonathan Cameron, linux-iio, fengguang.wu

On 02/26/2013 04:19 PM, Denis CIOCCA wrote:
>> IIRC this is a false positive warning?
> Yeah, only false positive warning.
> 
> 
>> I'll take the patch either way, but if it's a false positive
>> I'll queue it for the next cycle rather than send it on as
>> a fix for this one.
>>
> Thanks,
Being a contrary type (and because its early in the cycle and we
have a whole load of fixes going anyway) I've applied to this to
fixes-togreg rather than waiting for the next cycle ;)

> 
> Denis--
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2013-03-02 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 10:43 STMicroelectronics st_sensors fixed warning messages Denis CIOCCA
2013-02-26 10:43 ` [PATCH] iio:common: fixed all warning messages about uninitialized variables Denis CIOCCA
2013-02-26 16:14 ` STMicroelectronics st_sensors fixed warning messages Jonathan Cameron
2013-02-26 16:19   ` Denis CIOCCA
2013-03-02 16:38     ` Jonathan Cameron

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.