[PATCH] First cut of a adt7470 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

On Fri, 13 Jul 2007 14:08:53 +0200, Hans de Goede wrote:
> Notice that I use simple_strtoul, so val will never be < 0, if you write -4096 
> strtoul will not recognize the - and return 0.
> 
> I know it looks strange to store the return value in an int then, but in some 
> of the other store methods I need val to be signed, and for consistency I've 
> thus stored it into an int everywhere.

But wouldn't then a large input value (fitting in a long but not in an
int) be silently turned into a negative value, possibly doing crazy
things in the rest of the code?

-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux