Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4312676ybf; Wed, 4 Mar 2020 01:21:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vvYYvgfSue3dWxaVMkeg0B4vS4fDHU43CC+Szx7/6mukgcQJRgqxIGnKaOSpGUegs0WRmJb X-Received: by 2002:aca:aa53:: with SMTP id t80mr1068668oie.161.1583313697605; Wed, 04 Mar 2020 01:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583313697; cv=none; d=google.com; s=arc-20160816; b=u8x890tUtYmDX4Nuzd/aSJ+LG2vvekkCNpLqVLpSRpRNPDulLjUqL/zljEDWio7YxC lrxIH4a9xxLKxfq2YbH9Jbiq/dwXMGQQ6tVl5d0N4oNoXM9V9dAi96kLJXi6ultZG9OI ItPSZXf9s6B9b+o1qAdVS2fObZIW0q68JwcgC1lbd8240xhqCsJHV3bMB1Qwr1pUw5cA MKAZSX2Q5XNtoPLQnUI99LoBIMworspxZ3vwyDcijERnFomJ0PzodoVMcOyyEthWnyqo gdYAQG7lAV+59m2efj12OETwDLUSM7RY/Bqz9TCvwdkZYFENDWYCsm/FE2xw0SbslO4M N3Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=JATVORkTXzLpAcJPdiUDca3ufXsPYVsQtDmMg3d3MQM=; b=Z+aThrwfhbGlWHVtl3XQScotLSk8z396W64y1K6P1BPrCJa5fZJKO1DL2rE2Mfq/42 2KWrT+LVVPNsVCc8BkZMEZnOS2kV92FsQLf4iHrl0SSFn0BghA9sj37tTmcL2BdEOCUz Vw1X42JyHaKIOyaeQiZ/mOTDiQ94EbtyHdUwVIaE8fPH1w/+t7TWmBef2jqdDy4t9wmz CBfhqn2V25yZNifbyXKhvy6qXZ+ZwfNso1Zgsx+E8nGtjSdN7mWYUFuPkKWSUH+2TLja q5wkobPVLa9hoWIoL321F8FznOVa2tQEqvG71TF/hVZtsjrdssPrBOLNe6WBDwwuoiC6 K+Eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si718270otl.60.2020.03.04.01.21.24; Wed, 04 Mar 2020 01:21:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729090AbgCDJUR (ORCPT + 99 others); Wed, 4 Mar 2020 04:20:17 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:46366 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbgCDJUQ (ORCPT ); Wed, 4 Mar 2020 04:20:16 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j9QCJ-0007fz-7g; Wed, 04 Mar 2020 10:20:11 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id D1B151C21B0; Wed, 4 Mar 2020 10:20:10 +0100 (CET) Date: Wed, 04 Mar 2020 09:20:10 -0000 From: "tip-bot2 for Wen Yang" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] hrtimer: Cast explicitely to u32t in __ktime_divns() Cc: Wen Yang , Thomas Gleixner , x86 , LKML In-Reply-To: <20200130130851.29204-1-wenyang@linux.alibaba.com> References: <20200130130851.29204-1-wenyang@linux.alibaba.com> MIME-Version: 1.0 Message-ID: <158331361059.28353.6154145435691851897.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: 38f7b0b1316d435f38ec3f2bb078897b7a1cfdea Gitweb: https://git.kernel.org/tip/38f7b0b1316d435f38ec3f2bb078897b7a1cfdea Author: Wen Yang AuthorDate: Thu, 30 Jan 2020 21:08:51 +08:00 Committer: Thomas Gleixner CommitterDate: Wed, 04 Mar 2020 10:17:51 +01:00 hrtimer: Cast explicitely to u32t in __ktime_divns() do_div() does a 64-by-32 division at least on 32bit platforms, while the divisor 'div' is explicitly casted to unsigned long, thus 64-bit on 64-bit platforms. The code already ensures that the divisor is less than 2^32. Hence the proper cast type is u32. Signed-off-by: Wen Yang Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200130130851.29204-1-wenyang@linux.alibaba.com --- kernel/time/hrtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 3a609e7..d74fdcd 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -311,7 +311,7 @@ s64 __ktime_divns(const ktime_t kt, s64 div) div >>= 1; } tmp >>= sft; - do_div(tmp, (unsigned long) div); + do_div(tmp, (u32) div); return dclc < 0 ? -tmp : tmp; } EXPORT_SYMBOL_GPL(__ktime_divns);