Messages in this thread | | | Subject | Re: [PATCH] irda: irda-usb: use msecs_to_jiffies for conversions | From | Joe Perches <> | Date | Tue, 19 May 2015 20:57:17 -0700 |
| |
On Tue, 2015-05-19 at 18:44 -0700, Guenter Roeck wrote: > On Tue, May 19, 2015 at 02:09:07PM -0700, Joe Perches wrote: > > The other thing that could be done is to use > > max(1ul, msecs_to_jiffies()) > > so that there's always some delay even if HZ <= 50 > > > I may be mistaken, but I am quite sure that msecs_to_jiffies() always returns > at least 1 in such situations. Otherwise there would be lots of conversions > to 0 in the kernel.
Thanks Guenter
Nope, you're not mistaken.
Non 0 constants always return a value > 0
The existing uses like max(1ul, msecs_to_jiffies(<variable>)) just guard against <variable> being 0.
| |