Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933210AbbBIP6g (ORCPT ); Mon, 9 Feb 2015 10:58:36 -0500 Received: from www.osadl.org ([62.245.132.105]:43454 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932864AbbBIP63 (ORCPT ); Mon, 9 Feb 2015 10:58:29 -0500 From: Nicholas Mc Guire To: Greg Kroah-Hartman Cc: Jiri Slaby , Daniel Vetter , Adam Borowski , Peter Hurley , David Herrmann , Imre Deak , Takashi Iwai , Peng Fan , linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] vt: use msecs_to_jiffies for time conversion Date: Mon, 9 Feb 2015 10:54:10 -0500 Message-Id: <1423497250-3390-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1280 Lines: 37 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 --- Patch was compile tested with x86_64_defconfig (implies CONFIG_HW_CONSOLE=y and CONFIG_VT=y) Patch is against 3.19.0-rc7 (localversion-next is -next-20150209) drivers/tty/vt/vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 6e00572..ea7ba03 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -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; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/