From patchwork Tue Aug 24 13:53:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7ODrNbF031606 for ; Tue, 24 Aug 2010 13:53:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755215Ab0HXNxW (ORCPT ); Tue, 24 Aug 2010 09:53:22 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:55751 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185Ab0HXNxV (ORCPT ); Tue, 24 Aug 2010 09:53:21 -0400 Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0M1kNy-1P6vr62NhK-00tEiM; Tue, 24 Aug 2010 15:53:14 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Greg KH , linux-input@vger.kernel.org, Alan Cox , Dmitry Torokhov Subject: [PATCH v2] input: use PIT_TICK_RATE in vt beep ioctl Date: Tue, 24 Aug 2010 15:53:11 +0200 User-Agent: KMail/1.12.2 (Linux/2.6.35-16-generic; KDE/4.3.2; x86_64; ; ) Cc: linux-arm-kernel@lists.infradead.org, David Yang , Eric Miao , Emmanuel Colbus , Andrew Morton References: <201008241521.23459.arnd@arndb.de> In-Reply-To: <201008241521.23459.arnd@arndb.de> MIME-Version: 1.0 Message-Id: <201008241553.11219.arnd@arndb.de> X-Provags-ID: V02:K0:FDteDgfLuXCcsfrJ4hZE1EwuifzVRC4FNaRYcyZr9lN 4kYFVcHrqKmzKu2g4E1+LfSm7ui3HwJIDlfqTBZpiVYaLMfWWJ IKkIZ/sTJGSsuqH4cxdbVAHsowenohY/an8kXdN1PTdcgWn7Oq xoqhV722NpL2JPty84Tm7ZdAdgdkbkiYb3twRMq9Y9svDmJOPK gBAGCzV1ro0BLEcPvXTvg== Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 24 Aug 2010 13:53:23 +0000 (UTC) diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index cb19dbc..592d8d1 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c @@ -533,11 +533,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case KIOCSOUND: if (!perm) goto eperm; - /* FIXME: This is an old broken API but we need to keep it - supported and somehow separate the historic advertised - tick rate from any real one */ + /* + * The use of PIT_TICK_RATE is historic, it used to be + * the platform-dependent CLOCK_TICK_RATE between 2.6.12 + * and 2.6.36, which was a minor but unfortunate ABI + * change. + */ if (arg) - arg = CLOCK_TICK_RATE / arg; + arg = PIT_TICK_RATE / arg; kd_mksound(arg, 0); break; @@ -553,11 +556,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, */ ticks = HZ * ((arg >> 16) & 0xffff) / 1000; count = ticks ? (arg & 0xffff) : 0; - /* FIXME: This is an old broken API but we need to keep it - supported and somehow separate the historic advertised - tick rate from any real one */ if (count) - count = CLOCK_TICK_RATE / count; + count = PIT_TICK_RATE / count; kd_mksound(count, ticks); break; }