From patchwork Fri Nov 27 02:52:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 7710521 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E65CBF90C for ; Fri, 27 Nov 2015 02:54:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6532620592 for ; Fri, 27 Nov 2015 02:54:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89EF920620 for ; Fri, 27 Nov 2015 02:54:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a29BB-0003Wx-3D; Fri, 27 Nov 2015 02:54:33 +0000 Received: from mail-pa0-f65.google.com ([209.85.220.65]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a29Am-0003IA-9E; Fri, 27 Nov 2015 02:54:09 +0000 Received: by pabfh17 with SMTP id fh17so13448201pab.3; Thu, 26 Nov 2015 18:53:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iBCpvq7nn9oPvAcaRgNa4OxcYjPVc2YeqGwI/8y1QuU=; b=RuHsWKCp1+tRjKEEZzo4EIuayDDxwqNl/GEx2dET1dhqbnDLP8G7qpvF5EhFElEqcV N1dTWiTmh9ElC99Lb9ZckTQ5KBZMLvVuzfveI3EYqbsf+xmbtXUIqrlT3BxjlDCivdeq fffYORXEjFCS2Hy/NCr9SbBDGBklBVI1luSrp8d9H+U9cdscxiUWSpncyDW9dUYhjHBW 3GhiSzPiSks1Mu002d6Vds3Xk7gXu0dX2XSn+4mPbZAILCi1UIE+43lO3O2fQAts9y+7 wk4u++Sw7NFF1hcuFOyQ2PR9b42ZypOHl/be5tnyx4zLB31HlJQ5O3F585LPwlbn7gZi pE6A== X-Received: by 10.66.119.237 with SMTP id kx13mr64645310pab.158.1448592827644; Thu, 26 Nov 2015 18:53:47 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id r72sm30211624pfi.0.2015.11.26.18.53.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Nov 2015 18:53:46 -0800 (PST) From: Caesar Wang To: Eduardo Valentin Subject: [PATCH v1 2/5] thermal: rockchip: fix a impossible condition caused by the warning Date: Fri, 27 Nov 2015 10:52:23 +0800 Message-Id: <1448592746-2129-3-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448592746-2129-1-git-send-email-wxt@rock-chips.com> References: <1448592746-2129-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151126_185408_508050_63AB0C7D X-CRM114-Status: GOOD ( 10.83 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Zhang Rui , Dan Carpenter , Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As the Dan report the smatch check the thermal driver warning: drivers/thermal/rockchip_thermal.c:551 rockchip_configure_from_dt() warn: impossible condition '(thermal->tshut_temp > ((~0 >> 1))) => (s32min-s32max > s32max)' Since the Temperature is currently represented as int not long in the thermal driver. Fixes: commit 437df2172e8d ("thermal: rockchip: consistently use int for temperatures") Reported-by: Dan Carpenter Signed-off-by: Caesar Wang --- Changes in v1: None drivers/thermal/rockchip_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 5a8840b..d00765f 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -548,7 +548,7 @@ static int rockchip_configure_from_dt(struct device *dev, thermal->tshut_temp = shut_temp; } - if (thermal->tshut_temp > INT_MAX) { + if (!(thermal->tshut_temp < INT_MAX)) { dev_err(dev, "Invalid tshut temperature specified: %d\n", thermal->tshut_temp); return -ERANGE;