Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757245AbbLCBRH (ORCPT ); Wed, 2 Dec 2015 20:17:07 -0500 Received: from regular1.263xmail.com ([211.150.99.135]:46313 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbbLCBRE (ORCPT ); Wed, 2 Dec 2015 20:17:04 -0500 X-Greylist: delayed 2061 seconds by postgrey-1.27 at vger.kernel.org; Wed, 02 Dec 2015 20:17:03 EST X-263anti-spam: KSV:0;BIG:0;ABS:1;DNS:0;ATT:0;SPF:S; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ADDR-CHECKED: 0 X-RL-SENDER: wxt@rock-chips.com X-FST-TO: computersforpeace@gmail.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: wxt@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <565F9807.4080700@rock-chips.com> Date: Thu, 03 Dec 2015 09:16:55 +0800 From: Caesar Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Brian Norris CC: Heiko Stuebner , Eduardo Valentin , lkp@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Zhang Rui , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 06/10] thermal: rockchip: consistently use int for temperatures References: <1447044542-30859-1-git-send-email-wxt@rock-chips.com> <1447044542-30859-7-git-send-email-wxt@rock-chips.com> <20151202183851.GA91131@google.com> <565F8FFE.3080807@rock-chips.com> <20151203004903.GA9543@google.com> In-Reply-To: <20151203004903.GA9543@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1589 Lines: 49 Hi Brain, 于 2015年12月03日 08:49, Brian Norris 写道: > Hi Caesar, > > On Thu, Dec 03, 2015 at 08:42:38AM +0800, Caesar Wang wrote: >> ? 2015?12?03? 02:38, Brian Norris ??: >> >> [.....] >>> if (thermal->tshut_temp > INT_MAX) { >>> CID 1341498: Integer handling issues (CONSTANT_EXPRESSION_RESULT) >>> "thermal->tshut_temp > 2147483647 /* (int)(~0U >> 1) */" is always false regardless of the values of its operands. This occurs as the logical operand of if. >>> >>> I don't think this condition is even useful any more, so maybe we should >>> just kill the 'if' block. >> See the patch to fix >> it.----->(https://patchwork.kernel.org/patch/7720601/) >> > - if (thermal->tshut_temp > INT_MAX) { > + if (!(thermal->tshut_temp < INT_MAX)) { > > Huh? That still doesn't make much sense. The condition is still > impossible, since thermal->tshut_temp is an int. You've just made it > slightly harder for static analyzers to notice the impossibility. Okay, that's possible remove this condition as you said. - if (thermal->tshut_temp > INT_MAX) { - dev_err(dev, "Invalid tshut temperature specified: %d\n", - thermal->tshut_temp); - return -ERANGE; - } Thanks! > >> This patch is merged into kernel 4.4-rc3. > No it isn't, and I'm glad. The patch is silly. > > Brian > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/