lkml.org 
[lkml]   [2009]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V6 1/2] introduce ALS sysfs class
Date
On Tuesday 01 September 2009, Pavel Machek wrote:
>
> > > > IMO, 0 and -1 are not errors. they just suggest that the Ambient Light
> > > > illuminance is beyond the device support range, while the device is
> > > > still working normally.
> > > > what about exporting these values (0 and -1) to user space directly?
> > >
> > > Returning 0 for "below" range and 99999999 for "above" range would be
> > > nice, yes.
> >
> > Why not 0 and "all ones" or 0 and -1.
> >
> > Is there anything wrong with -1 in particular?
>
> Normal people expect -1 to be less than 123, and output is in ascii. If
> you make it ((unsigned) ~0) I guess that becomes acceptable.

Well, "-1" is a perfectly valid alphanumerical representation of an int.
I don't really see the problem with the "-", unless we're talking about some
broken user space, that is.

Rafael


\
 
 \ /
  Last update: 2009-09-02 23:15    [W:0.113 / U:1.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site