From patchwork Mon Jan 4 07:26:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 562253 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E88931402DE for ; Mon, 4 Jan 2016 18:36:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=IbJ0CnfY; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2264D4B7AD; Mon, 4 Jan 2016 08:36:24 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L08aRpOLw_PB; Mon, 4 Jan 2016 08:36:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BFB114B734; Mon, 4 Jan 2016 08:36:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D7064B734 for ; Mon, 4 Jan 2016 08:36:18 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ALxaCtqai7yh for ; Mon, 4 Jan 2016 08:36:18 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by theia.denx.de (Postfix) with ESMTPS id 69AD74B71C for ; Mon, 4 Jan 2016 08:36:13 +0100 (CET) Received: by mail-pf0-f181.google.com with SMTP id e65so145234306pfe.1 for ; Sun, 03 Jan 2016 23:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=uOqKD4NRiWzU4uJm5zBW+ppV0oT5LDOygu5FkbUod1M=; b=IbJ0CnfYZMjlpOB/ByF9h6X5rBqnHCmviZ5OW+YLeNScE2GS83MPTxlqPoMSbASyIJ a9zDEVffcdPtNhpO//UvokxJoq4RP4JouMn3zi2Us5PcBMDVco/jus5nkpK1n7RDXD17 ycrCrJmHy4EYFbtkZuFPPbou7Imkxx1HnS0q4czUrPp0L2wdub6SyrF8ZrwMBOyuOROU hZVw0Lrb5mfAERr6fBIK7Q33ayDiFrGOOtDPpXi+B/kDqtf0Tu+Jy80hPg+0GEY0jd1Z N2eVmj1+G5QiZKZr7aepwtM7vFEtPmaOCHDbnmxIUa+DBPOP9gBpiI+dPf9pw49D+1aE WfJA== X-Received: by 10.98.13.16 with SMTP id v16mr123787993pfi.129.1451892971737; Sun, 03 Jan 2016 23:36:11 -0800 (PST) Received: from linux-7smt.suse (gate-zmy3.freescale.com. [192.88.167.1]) by smtp.gmail.com with ESMTPSA id rz10sm123788292pac.29.2016.01.03.23.36.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Jan 2016 23:36:11 -0800 (PST) From: Peng Fan X-Google-Original-From: Peng Fan To: u-boot@lists.denx.de Date: Mon, 4 Jan 2016 15:26:30 +0800 Message-Id: <1451892390-4754-1-git-send-email-peng.fan@nxp.com> X-Mailer: git-send-email 2.6.2 Cc: "Ye.Li" , Przemyslaw Marczak Subject: [U-Boot] [PATCH] pfuze: Fix unsigned variable for less-than-zero comparison X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: "Ye.Li" According to the Coverity result, a unsigned int variable is used fo less- than-zero comparison, the result is never true. Need to fix the variable type to signed int. Signed-off-by: Ye.Li Signed-off-by: Peng Fan Cc: Przemyslaw Marczak Cc: Stefano Babic Reviewed-by: Stefano Babic --- board/freescale/common/pfuze.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c index 783c46d..69afa83 100644 --- a/board/freescale/common/pfuze.c +++ b/board/freescale/common/pfuze.c @@ -13,7 +13,8 @@ int pfuze_mode_init(struct pmic *p, u32 mode) { unsigned char offset, i, switch_num; - u32 id, ret; + u32 id; + int ret; pmic_reg_read(p, PFUZE100_DEVICEID, &id); id = id & 0xf;