Re: [Y2038] [PATCH] hil_mlc: convert timeval to timespec64

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

 



> 在 2015年10月23日,17:45,Arnd Bergmann <arnd@xxxxxxxx> 写道:
> 
> On Friday 23 October 2015 17:12:38 Pingbo Wen wrote:
>> On Monday, October 19, 2015 04:58 PM, Arnd Bergmann wrote:
>>>> -            do_gettimeofday(&tv);
>>>> -        
> Handling the jiffies overflow is trivially done through the time_before()
> and time_after() helpers, like
> 
> 
> 	start = jiffies;
> 	...
> 	now = jiffies;
> 	timeout = start + HZ * timeout_usec / USEC_PER_SEC;
> 	if (time_after(now, start + timeout_jiffies)
> 		timeout();
> 	else
> 		mod_timer(timer, start + timeout_jiffies);
> 
> The time_after function works because unsigned overflow is well-defined
> in C (unlike signed overflow).
> 

Make sense, I will try this in next version.

Thanks,
Pingbo

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux