On Mon, 1 Aug 2011 23:11:17 +0200Thanks Andrew for pointing out this.
Christian Lamparter<chunkeey@xxxxxxxxxxxxxx> wrote:
On Monday, August 01, 2011 10:29:06 PM Andrew Morton wrote:On Mon, 25 Jul 2011 17:16:23 +0200The sensor is used to park the hdd in case of an "accident". However,
__ric Piel<eric.piel@xxxxxxxxxxxxxxxx> 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?
if the sensors is not working, the user should at least get a WARN
that something is very wrong, right?
Well if we're doing this for the user's benefit (most WARNs are for developers)
then the message should be user-useful. That one isn't, really.
Can we come up with some text which is more useful to the user/operator and
won't require him/her/it to send emails and raise bug reports?
Also, the stack trace which WARN emits is not useful in this application?