public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Bug in twl4030backupbatt_voltage()
@ 2008-09-03 15:10 Adrian Hunter
  2008-09-09 17:42 ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2008-09-03 15:10 UTC (permalink / raw)
  To: linux-omap; +Cc: madhu.cr

In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
fixed a bug with the use of function twl4030_madc_conversion()
relating to the local variable 'struct twl4030_madc_request req'
not being fully initialised.

The same problem appears to be in the function
twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c


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

* Re: Bug in twl4030backupbatt_voltage()
  2008-09-03 15:10 Bug in twl4030backupbatt_voltage() Adrian Hunter
@ 2008-09-09 17:42 ` Tony Lindgren
  2008-09-10  7:28   ` Adrian Hunter
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2008-09-09 17:42 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-omap, madhu.cr

* Adrian Hunter <ext-adrian.hunter@nokia.com> [080903 08:08]:
> In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
> fixed a bug with the use of function twl4030_madc_conversion()
> relating to the local variable 'struct twl4030_madc_request req'
> not being fully initialised.
>
> The same problem appears to be in the function
> twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c

Thanks, I'll initialize it to NULL. Wouldn't it have been easier just
to write a patch instead of the description above? :)

Tony

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

* Re: Bug in twl4030backupbatt_voltage()
  2008-09-09 17:42 ` Tony Lindgren
@ 2008-09-10  7:28   ` Adrian Hunter
  2008-09-10 13:12     ` Madhusudhan Chikkature
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Hunter @ 2008-09-10  7:28 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, madhu.cr

Tony Lindgren wrote:
> * Adrian Hunter <ext-adrian.hunter@nokia.com> [080903 08:08]:
>> In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
>> fixed a bug with the use of function twl4030_madc_conversion()
>> relating to the local variable 'struct twl4030_madc_request req'
>> not being fully initialised.
>>
>> The same problem appears to be in the function
>> twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c
> 
> Thanks, I'll initialize it to NULL. Wouldn't it have been easier just
> to write a patch instead of the description above? :)

Apparently.

There is also req.do_avg which should be zero, if you assume the programmer's
intent was to have uninitialised members set to zero.

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

* Re: Bug in twl4030backupbatt_voltage()
  2008-09-10  7:28   ` Adrian Hunter
@ 2008-09-10 13:12     ` Madhusudhan Chikkature
  2008-09-10 15:39       ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Madhusudhan Chikkature @ 2008-09-10 13:12 UTC (permalink / raw)
  To: Adrian Hunter, Tony Lindgren; +Cc: linux-omap


----- Original Message ----- 
From: "Adrian Hunter" <ext-adrian.hunter@nokia.com>
To: "Tony Lindgren" <tony@atomide.com>
Cc: <linux-omap@vger.kernel.org>; <madhu.cr@ti.com>
Sent: Wednesday, September 10, 2008 12:58 PM
Subject: Re: Bug in twl4030backupbatt_voltage()


> Tony Lindgren wrote:
>> * Adrian Hunter <ext-adrian.hunter@nokia.com> [080903 08:08]:
>>> In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
>>> fixed a bug with the use of function twl4030_madc_conversion()
>>> relating to the local variable 'struct twl4030_madc_request req'
>>> not being fully initialised.
>>>
>>> The same problem appears to be in the function
>>> twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c
>> 
>> Thanks, I'll initialize it to NULL. Wouldn't it have been easier just
>> to write a patch instead of the description above? :)
> 
> Apparently.
> 
> There is also req.do_avg which should be zero, if you assume the programmer's
> intent was to have uninitialised members set to zero.
I guess, I did not look at all the other members of the "twl4030_madc_request" structure. I might have missed it.
The do_avg and func_cb fields can both be set to NULL.

Regards,
Madhu
> 
>

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

* Re: Bug in twl4030backupbatt_voltage()
  2008-09-10 13:12     ` Madhusudhan Chikkature
@ 2008-09-10 15:39       ` Tony Lindgren
  2008-09-11  3:32         ` Madhusudhan Chikkature
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2008-09-10 15:39 UTC (permalink / raw)
  To: Madhusudhan Chikkature; +Cc: Adrian Hunter, linux-omap

* Madhusudhan Chikkature <madhu.cr@ti.com> [080910 06:12]:
> 
> ----- Original Message ----- 
> From: "Adrian Hunter" <ext-adrian.hunter@nokia.com>
> To: "Tony Lindgren" <tony@atomide.com>
> Cc: <linux-omap@vger.kernel.org>; <madhu.cr@ti.com>
> Sent: Wednesday, September 10, 2008 12:58 PM
> Subject: Re: Bug in twl4030backupbatt_voltage()
> 
> 
> > Tony Lindgren wrote:
> >> * Adrian Hunter <ext-adrian.hunter@nokia.com> [080903 08:08]:
> >>> In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
> >>> fixed a bug with the use of function twl4030_madc_conversion()
> >>> relating to the local variable 'struct twl4030_madc_request req'
> >>> not being fully initialised.
> >>>
> >>> The same problem appears to be in the function
> >>> twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c
> >> 
> >> Thanks, I'll initialize it to NULL. Wouldn't it have been easier just
> >> to write a patch instead of the description above? :)
> > 
> > Apparently.
> > 
> > There is also req.do_avg which should be zero, if you assume the programmer's
> > intent was to have uninitialised members set to zero.
> I guess, I did not look at all the other members of the "twl4030_madc_request" structure. I might have missed it.
> The do_avg and func_cb fields can both be set to NULL.

Can you please check the code and send a patch?

Thanks,

Tony

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

* Re: Bug in twl4030backupbatt_voltage()
  2008-09-10 15:39       ` Tony Lindgren
@ 2008-09-11  3:32         ` Madhusudhan Chikkature
  0 siblings, 0 replies; 6+ messages in thread
From: Madhusudhan Chikkature @ 2008-09-11  3:32 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Adrian Hunter, linux-omap


----- Original Message ----- 
From: "Tony Lindgren" <tony@atomide.com>
To: "Madhusudhan Chikkature" <madhu.cr@ti.com>
Cc: "Adrian Hunter" <ext-adrian.hunter@nokia.com>; <linux-omap@vger.kernel.org>
Sent: Wednesday, September 10, 2008 9:09 PM
Subject: Re: Bug in twl4030backupbatt_voltage()


>* Madhusudhan Chikkature <madhu.cr@ti.com> [080910 06:12]:
>> 
>> ----- Original Message ----- 
>> From: "Adrian Hunter" <ext-adrian.hunter@nokia.com>
>> To: "Tony Lindgren" <tony@atomide.com>
>> Cc: <linux-omap@vger.kernel.org>; <madhu.cr@ti.com>
>> Sent: Wednesday, September 10, 2008 12:58 PM
>> Subject: Re: Bug in twl4030backupbatt_voltage()
>> 
>> 
>> > Tony Lindgren wrote:
>> >> * Adrian Hunter <ext-adrian.hunter@nokia.com> [080903 08:08]:
>> >>> In the omap tree, commit f91fd98be045bec9c18e13110f22dafd44cb84b5
>> >>> fixed a bug with the use of function twl4030_madc_conversion()
>> >>> relating to the local variable 'struct twl4030_madc_request req'
>> >>> not being fully initialised.
>> >>>
>> >>> The same problem appears to be in the function
>> >>> twl4030backupbatt_voltage() which is in drivers/power/twl4030_bci_battery.c
>> >> 
>> >> Thanks, I'll initialize it to NULL. Wouldn't it have been easier just
>> >> to write a patch instead of the description above? :)
>> > 
>> > Apparently.
>> > 
>> > There is also req.do_avg which should be zero, if you assume the programmer's
>> > intent was to have uninitialised members set to zero.
>> I guess, I did not look at all the other members of the "twl4030_madc_request" structure. I might have missed it.
>> The do_avg and func_cb fields can both be set to NULL.
> 
> Can you please check the code and send a patch?
Yes. I will do that.

Regards,
Madhu
> 
> Thanks,
> 
> Tony
> 
>

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

end of thread, other threads:[~2008-09-11  3:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 15:10 Bug in twl4030backupbatt_voltage() Adrian Hunter
2008-09-09 17:42 ` Tony Lindgren
2008-09-10  7:28   ` Adrian Hunter
2008-09-10 13:12     ` Madhusudhan Chikkature
2008-09-10 15:39       ` Tony Lindgren
2008-09-11  3:32         ` Madhusudhan Chikkature

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