]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
vt: use msecs_to_jiffies for time conversion
authorNicholas Mc Guire <hofrat@osadl.org>
Mon, 9 Feb 2015 15:54:10 +0000 (10:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 03:02:26 +0000 (04:02 +0100)
Converting milliseconds to jiffies by "val * HZ / 1000" is technically
OK but msecs_to_jiffies(val) is the cleaner solution and handles all
corner cases correctly. This is a minor API consolidation only and
should make things more readable.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c

index 57ed647658beada18bc66b9254d85bb13bb54ec8..edf17b4e385fe88f6e222649ac27d33c48c246ce 100644 (file)
@@ -1573,7 +1573,7 @@ static void setterm_command(struct vc_data *vc)
                case 11: /* set bell duration in msec */
                        if (vc->vc_npar >= 1)
                                vc->vc_bell_duration = (vc->vc_par[1] < 2000) ?
-                                       vc->vc_par[1] * HZ / 1000 : 0;
+                                       msecs_to_jiffies(vc->vc_par[1]) : 0;
                        else
                                vc->vc_bell_duration = DEFAULT_BELL_DURATION;
                        break;