Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2215056yba; Mon, 22 Apr 2019 02:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKKj2IWToUKeE1xlWVMmRZ5Pknx1PJwsWC9pJ3fFL49Z77i9rgp9zWlejnTZaTl2EbkrM9 X-Received: by 2002:a62:41dc:: with SMTP id g89mr18977409pfd.109.1555925777835; Mon, 22 Apr 2019 02:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555925777; cv=none; d=google.com; s=arc-20160816; b=HJ17A6rKRGgoGGM4bs9IO6HjdLI0vDAUTNJnaw+ntHHnlhJ8Ww7qgFKEHnVfzkp6Rx BhqA9zb6eR14mgJDOKjQMo2t6H4CJeskp29ZOTfmYWyofoxouH5dDH43mE5+Cz6P90BJ 2E516Mn/+L2RBd5cLL/OYrchpSlomZJfQtGYnyOiBv3rFDbEPf67oQ9OJasFoq4Nq2ff DGv3uLTMwUkzYtxBbdfKKcOV5GwSWzVFQx0Qy6Njod1PGU1gN5cFKzdSnsGiup6Morin BSjtJXuaWe8ePlPeZIJZaZILUNl8N+QmioIStvhGf6T/h0i8QJVtQssjcqE8yr+VuI+b SndQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=uyd2xviN2IvXkdq2AdoL+zoAvgNajflM6YruKctg5AY=; b=z4/c0nqDO306u7+3eSsVm862EGvePZR9noaHcGtePVeG1JFm5twilhu8C2rm5EF901 SXZtBMGYtut4B7MpUdSk0RWadeTC0yN38jks4HWHGUsH7ISLhAWQUY5eEtfPqjvMowgF sQiPMaByq4MF0WryuZQWUs4QnA0ixkeEvHRUuT3BgEW7iAinGPIcrUstKkOrbJwsuM+t kRFQcVO5vtG/JOQSj27jhPvlygFTtyhrMf+gyrhgEfpqPjs/DnVSovGwNmkjp0M2w+IT uVGw+1BBswvdpVR8Vp3ArYkx0Y9QLuEL7aFpbcF+LuN5PcKLRGruTm2m7gctyA+EYWQT HRgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fnD1MrCu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si13942162pfo.133.2019.04.22.02.36.02; Mon, 22 Apr 2019 02:36:17 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fnD1MrCu; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbfDVJee (ORCPT + 99 others); Mon, 22 Apr 2019 05:34:34 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33624 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbfDVJed (ORCPT ); Mon, 22 Apr 2019 05:34:33 -0400 Received: by mail-pf1-f195.google.com with SMTP id h5so5463609pfo.0 for ; Mon, 22 Apr 2019 02:34:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uyd2xviN2IvXkdq2AdoL+zoAvgNajflM6YruKctg5AY=; b=fnD1MrCusBq9asUNdB0n028WwQODeb3jovYP+lzBG/grzxKOwr1OZqeP9/LznKbASU aFZDAKyJm4cTfaShXhpZXW+HH0bZRH5xFgNVyUnpTKjTB7i0Pjxrkr56UrF2T9fWVOuR U3hSGHfXVrF82E0hIlKZt2UuLdJh4IRj5wgVnOPjJwPl3VtnLLarqOV4OI+JFi3Cyv68 iBXXbV5ZAZCoSvioa3aWYCzhP0TgWxZZ631WpM2b8OWSHaKWUB7Cv6U2gQPEgKZz0V9m BB6mdZCFIdW9mUHiD2fWwiKGeNLnaBT79l2WXX/iJ88JgO11ocYsvFQqWWt5a/KpeuWn p76g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uyd2xviN2IvXkdq2AdoL+zoAvgNajflM6YruKctg5AY=; b=F2dLZ44eeKbPnBL/FP1ys8U2Dd9x5DVY63vAN80wRIAlbRaOt7C8mx12KElmcGFBpC O/4mcXNr19kLR6dpqO/oapMxzPTZf9R+QN3HxsIh1N7NVLi3DEdAFSp6VLT9XoB7wmlU 5si6I/xTeh3gK8rl5h4GYcsi7KzAaP49vr9DNB5qbzaszWjlzCfOcWqgVM/kL+wQx8hq GfO3Y5NcPOMMpAqrtEkyfzS/2jn2p9L5Iinur5O2al6ZDxBuoSRQ8xkT7aKh+D8TjLhZ VT3In98oidKE1IicuMfuVifkaMtkmTH/pKvysYYQVuSVTjxTULXqJbQSG7SzF1NF/suM RMpw== X-Gm-Message-State: APjAAAW0KgPdzrkpvFcdZEHkVBkdOa/B9XqhywwRYacDZXlKErn92UYO AEfa10C0zGTCbXX8MZQ9O2nZ7zWCeiuAFQ== X-Received: by 2002:a62:6086:: with SMTP id u128mr19852822pfb.148.1555925673117; Mon, 22 Apr 2019 02:34:33 -0700 (PDT) Received: from localhost.localdomain (ch.ptr162.ptrcloud.net. [153.122.97.60]) by smtp.gmail.com with ESMTPSA id x8sm14609477pgp.48.2019.04.22.02.34.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Apr 2019 02:34:31 -0700 (PDT) From: Weikang shi To: john.stultz@linaro.org Cc: tglx@linutronix.de, sboyd@kernel.org, linux-kernel@vger.kernel.org, swkhack@qq.com, swkhack Subject: [PATCH] time: fix a assignment error in ntp module Date: Mon, 22 Apr 2019 17:34:21 +0800 Message-Id: <20190422093421.47896-1-swkhack@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: swkhack It is meanless to check a 64bit(txc->constant) value is postive when the value has to be assigned to a 32 bit variable(*time_tai). So I make a temp type conversion before the compare. Signed-off-by: swkhack --- kernel/time/ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 92a90014a..6b454eafc 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c @@ -690,7 +690,7 @@ static inline void process_adjtimex_modes(const struct __kernel_timex *txc, time_constant = max(time_constant, 0l); } - if (txc->modes & ADJ_TAI && txc->constant > 0) + if (txc->modes & ADJ_TAI && (int)txc->constant > 0) *time_tai = txc->constant; if (txc->modes & ADJ_OFFSET) -- 2.17.1