From patchwork Mon Mar 10 03:33:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 25949 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F7C12055F for ; Mon, 10 Mar 2014 03:36:26 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kq14sf17370206pab.6 for ; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=0QOhd+e3aXvl762az80MfXWlP+1W8zNh6reCu0c5PGo=; b=WkyrRuTLPQgo+qPyNh9DeFG8TNVJA3gVTp7UmG+wKalMuWp3i16ZuwXSDkDgFCITT9 lyon/lJp0WsmetJP2/DNQV0HiJDHG5v40PxyK1AutCe9N0pe6pcBClqjILnvmC8WuL9Y XSPoX24y9IIzWpoEWRE0wJK7i04w9SBnA9m84ILPcTp+4wEaXn/pb5Yv4CjeXqGuMgjH 7LdDBZi0OiSMLlgxalFopOXJCk83pW4BT7DO9TeWIJ7mtsExQ6mfsMJcCQ6gQm6tUZgK erpHfqjHtuX+ub4CZ8YHkPtamHnMaDydEa6MVXbaDEDDwMezg+FNunfpGVJ2Nhm7GVyW iqbQ== X-Gm-Message-State: ALoCoQlhZjXqWqu/p2z14HjWWYbjNnZt5Kpqw4eePSwLQIF776Fzy1djWCReCZWF20eQUWOKLGzF X-Received: by 10.66.246.194 with SMTP id xy2mr13348509pac.36.1394422586283; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.47 with SMTP id s44ls2043240qgs.70.gmail; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) X-Received: by 10.221.37.1 with SMTP id tc1mr62698vcb.32.1394422586154; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id sn5si269583vdc.128.2014.03.09.20.36.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Mar 2014 20:36:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so6421760veb.6 for ; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) X-Received: by 10.220.164.80 with SMTP id d16mr20409286vcy.15.1394422586065; Sun, 09 Mar 2014 20:36:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp91012vck; Sun, 9 Mar 2014 20:36:25 -0700 (PDT) X-Received: by 10.180.149.206 with SMTP id uc14mr6320188wib.10.1394422584915; Sun, 09 Mar 2014 20:36:24 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id pm11si1502165wic.1.2014.03.09.20.36.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Mar 2014 20:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMr0R-0001cw-1b; Mon, 10 Mar 2014 03:35:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMr0O-0004kp-KG; Mon, 10 Mar 2014 03:35:56 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WMr0L-0004kC-U7 for linux-arm-kernel@lists.infradead.org; Mon, 10 Mar 2014 03:35:54 +0000 Received: by mail-pb0-f49.google.com with SMTP id jt11so6642111pbb.36 for ; Sun, 09 Mar 2014 20:35:31 -0700 (PDT) X-Received: by 10.68.134.198 with SMTP id pm6mr37824060pbb.9.1394422531738; Sun, 09 Mar 2014 20:35:31 -0700 (PDT) Received: from localhost.localdomain ([223.240.21.180]) by mx.google.com with ESMTPSA id iv2sm60098787pbc.19.2014.03.09.20.35.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 09 Mar 2014 20:35:30 -0700 (PDT) From: Zhangfei Gao To: Dan Carpenter , Mike Turquette Subject: [PATCH] clk: hisilicon: fix warning from smatch Date: Mon, 10 Mar 2014 11:33:20 +0800 Message-Id: <1394422400-17639-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140309_233554_040868_3ED8ACF5 X-CRM114-Status: UNSURE ( 9.22 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Zhangfei Gao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 drivers/clk/hisilicon/clk-hi3620.c:338 mmc_clk_delay() warn: always true condition '(para >= 0) => (0-u32max >= 0)' Reported-by: Dan Carpenter Signed-off-by: Zhangfei Gao --- drivers/clk/hisilicon/clk-hi3620.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c index 38faa469d288..e75f742ca422 100644 --- a/drivers/clk/hisilicon/clk-hi3620.c +++ b/drivers/clk/hisilicon/clk-hi3620.c @@ -335,15 +335,14 @@ static u32 mmc_clk_delay(u32 val, u32 para, u32 off, u32 len) { u32 i; - if (para >= 0) { - for (i = 0; i < len; i++) { - if (para % 2) - val |= 1 << (off + i); - else - val &= ~(1 << (off + i)); - para = para >> 1; - } + for (i = 0; i < len; i++) { + if (para % 2) + val |= 1 << (off + i); + else + val &= ~(1 << (off + i)); + para = para >> 1; } + return val; }