Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: legotower: use msecs_to_jiffies for time conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nicholas Mc Guire and committed by
Greg Kroah-Hartman
8f7e9473 9751afbb

+3 -3
+3 -3
drivers/usb/misc/legousbtower.c
··· 574 574 } 575 575 576 576 if (read_timeout) { 577 - timeout = jiffies + read_timeout * HZ / 1000; 577 + timeout = jiffies + msecs_to_jiffies(read_timeout); 578 578 } 579 579 580 580 /* wait for data */ ··· 592 592 /* reset read timeout during read or write activity */ 593 593 if (read_timeout 594 594 && (dev->read_buffer_length || dev->interrupt_out_busy)) { 595 - timeout = jiffies + read_timeout * HZ / 1000; 595 + timeout = jiffies + msecs_to_jiffies(read_timeout); 596 596 } 597 597 /* check for read timeout */ 598 598 if (read_timeout && time_after (jiffies, timeout)) { ··· 831 831 dev->read_buffer_length = 0; 832 832 dev->read_packet_length = 0; 833 833 spin_lock_init (&dev->read_buffer_lock); 834 - dev->packet_timeout_jiffies = packet_timeout * HZ / 1000; 834 + dev->packet_timeout_jiffies = msecs_to_jiffies(packet_timeout); 835 835 dev->read_last_arrival = jiffies; 836 836 837 837 init_waitqueue_head (&dev->read_wait);