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

2015-05-25 Thread David Miller
From: Nicholas Mc Guire Date: Sat, 23 May 2015 14:46:30 +0200 > API compliance scanning with coccinelle flagged: > > Converting milliseconds to jiffies by "val * HZ / 1000" is technically > is not a clean solution as it does not handle all corner cases correctly. > By changing the conversion to

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

2015-05-23 Thread Nicholas Mc Guire
API compliance scanning with coccinelle flagged: Converting milliseconds to jiffies by "val * HZ / 1000" is technically is not a clean solution as it does not handle all corner cases correctly. By changing the conversion to use msecs_to_jiffies(val) conversion is correct in all cases. in the curr

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

2015-05-19 Thread Joe Perches
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 quit

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

2015-05-19 Thread Guenter Roeck
On Tue, May 19, 2015 at 02:09:07PM -0700, Joe Perches wrote: > On Tue, 2015-05-19 at 16:45 -0400, David Miller wrote: > > From: Joe Perches > > Date: Tue, 19 May 2015 07:32:15 -0700 > > > > > On Tue, 2015-05-19 at 12:51 +0200, Nicholas Mc Guire wrote: > > >> Converting milliseconds to jiffies by

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

2015-05-19 Thread Joe Perches
On Tue, 2015-05-19 at 16:45 -0400, David Miller wrote: > From: Joe Perches > Date: Tue, 19 May 2015 07:32:15 -0700 > > > On Tue, 2015-05-19 at 12:51 +0200, Nicholas Mc Guire wrote: > >> Converting milliseconds to jiffies by "val * HZ / 1000" is technically > >> is not a clean solution as it does

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

2015-05-19 Thread David Miller
From: Joe Perches Date: Tue, 19 May 2015 07:32:15 -0700 > On Tue, 2015-05-19 at 12:51 +0200, Nicholas Mc Guire wrote: >> Converting milliseconds to jiffies by "val * HZ / 1000" is technically >> is not a clean solution as it does not handle all corner cases correctly. >> By changing the conversio

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

2015-05-19 Thread Joe Perches
On Tue, 2015-05-19 at 12:51 +0200, Nicholas Mc Guire wrote: > Converting milliseconds to jiffies by "val * HZ / 1000" is technically > is not a clean solution as it does not handle all corner cases correctly. > By changing the conversion to use msecs_to_jiffies(val) conversion is > correct in all c

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

2015-05-19 Thread Nicholas Mc Guire
API compliance scanning with coccinelle flagged: Converting milliseconds to jiffies by "val * HZ / 1000" is technically is not a clean solution as it does not handle all corner cases correctly. By changing the conversion to use msecs_to_jiffies(val) conversion is correct in all cases. in the curr