Thread (6 messages) flat view 6 messages, 4 authors, 2015-05-20

Re: [PATCH] irda: irda-usb: use msecs_to_jiffies for conversions

From: Joe Perches <joe@perches.com>
Date: 2015-05-20 03:57:23
Also in: lkml

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:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help