lkml.org 
[lkml]   [2011]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 01/10] lis3lv02d: avoid divide by zero due to unchecked
Date
On Monday, August 01, 2011 10:29:06 PM Andrew Morton wrote:
> On Mon, 25 Jul 2011 17:16:23 +0200
> __ric Piel <eric.piel@tremplin-utc.net> wrote:
>
> > +static int lis3lv02d_get_pwron_wait(struct lis3lv02d *lis3)
> > +{
> > + int div = lis3lv02d_get_odr();
> > +
> > + if (WARN_ONCE(div == 0, "device returned spurious data"))
> > + return -ENXIO;
> > +
> > + /* LIS3 power on delay is quite long */
> > + msleep(lis3->pwron_delay / div);
> > + return 0;
> > +}
>
> The WARN_ONCE may not be very useful. The user gets worried, might
> report it (often to a distro, not to you!). But we won't actually *do*
> anything with the information?
The sensor is used to park the hdd in case of an "accident". However,
if the sensors is not working, the user should at least get a WARN
that something is very wrong, right?

Regards,
Chr


\
 
 \ /
  Last update: 2011-08-01 23:13    [from the cache]
©2003-2011 Jasper Spaans