Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp940151pxb; Wed, 3 Mar 2021 21:52:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUYzQY/7ebR2waf/fwbskO99rdvhtfVN5BCREZ9F9SC/nsyHfD8uozkb9dL0RLWXZJ8Spq X-Received: by 2002:a17:906:8a6e:: with SMTP id hy14mr2491468ejc.356.1614837128857; Wed, 03 Mar 2021 21:52:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837128; cv=none; d=google.com; s=arc-20160816; b=Q7uKKle28f63ChzU0dEdlt5hztPNM2Fui6+EaOyZNaCS8ETqAsMxy7UGzo7p0kGSXO HFsHjJYOHdotb/fMk8UQ1GGIK92VpZXE4JWqjf6a4CIn4AdmDOKlDIMEB5Dxb1HYS84F uZ0muMEAK4e48R3Ffm4HvDCus5MBVqcsPaYuCHHCEpvjhOPBHyUooQaKV1p4nYaPPwf+ N5nlP1fw6pMAnmemSoGvmYgy3Km1LyFfZ0NkKqUf/u6n/EKA4K3dAlATv4dL8nzacBnp hbxPbVBifd+jUUWDINrh6NcIbM+IR2esUConpjvtbZd331vl64ArYLFGlJU2TqtbARB7 4cZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BOWe22lhw6PD00wgwtHN87jk4uUzlnrc0SxiU1H0cBQ=; b=FQLqwxemX6O2vtNEHChUjN0ESqAKJ8moJkkgU6bZBjQjTG22oWUzmczBBq20hZdFY4 euBGQrcYCxT4fVs7EZSENOfxL40Eg9jtNGpZqUx0vgONii5N4KD86FEqUwT96D6MedmW hEowVUcO5GhtRSygOKzkGUnc8wrXzFaXeekfPOIe0EbL1gaWFeDkSkJ+wRYg98b/0wcw AoZEkXISiVDtrCdnfQQ2Ao0jU/DHYLUR8TrsDO/dEGPlaK6VLH4X+Efd6sUCFqTARjH7 ZoIOdLX+pvEvKhfrIBtpCtBsSIzpT2Yv2K+70L4+vzO4eeN1TTl0lmGhL+6GDogMpkpv vu8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si16876945edm.396.2021.03.03.21.51.46; Wed, 03 Mar 2021 21:52:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349335AbhCBHPP (ORCPT + 99 others); Tue, 2 Mar 2021 02:15:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:39620 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1577539AbhCBGXu (ORCPT ); Tue, 2 Mar 2021 01:23:50 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 56B31AF9C; Tue, 2 Mar 2021 06:22:17 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 11/44] tty: 8250, use ms_to_ktime Date: Tue, 2 Mar 2021 07:21:41 +0100 Message-Id: <20210302062214.29627-11-jslaby@suse.cz> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210302062214.29627-1-jslaby@suse.cz> References: <20210302062214.29627-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This really eliminates multiplications from the assembly. I would have thought they are optimized by inlining ktime_set, but not on x86_64 with gcc 10. Signed-off-by: Jiri Slaby --- drivers/tty/serial/8250/8250_port.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index b0af13074cd3..167c1e3e53bc 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1487,11 +1487,7 @@ static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t) static void start_hrtimer_ms(struct hrtimer *hrt, unsigned long msec) { - long sec = msec / 1000; - long nsec = (msec % 1000) * 1000000; - ktime_t t = ktime_set(sec, nsec); - - hrtimer_start(hrt, t, HRTIMER_MODE_REL); + hrtimer_start(hrt, ms_to_ktime(msec), HRTIMER_MODE_REL); } static void __stop_tx_rs485(struct uart_8250_port *p) -- 2.30.1