[lkml]   [2005]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2.6] I2C: New chip driver: sis5595

Quoting myself:

> To me, the only acceptable simplification is
> the initialization of "last_updated" to something which ensures that
> the first update attempt will succeed - providing we actually can do
> that.

On second thought, we obviously cannot, because jiffies wrap, so there is
no single initial value of "last_updated", either relative or
absolute, which can ensure this condition to be true. I think we are
stuck we this "valid" flag, or at least with the concept thereof.
Possibly we can use "last_updated" itself as a flag if we absolutely
want to get rid of "valid". "last_updated == 0" would mean the same
as "valid == 0" did. The probability of "last_updated" to become 0
again after init time is obviously thin, and it wouldn't really hurt if
it did (it would simply allow an extra update to happen). That said,
this makes the code somewhat trickier.

What could (and should) be done anyway is to use time_after() or
something equivalent for the jiffies checks, instead of direct
coparison, in all hardware monitoring drivers.

Jean Delvare
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:10    [W:0.056 / U:21.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site