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: 3801121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C58CC9F2BB for ; Mon, 10 Mar 2014 03:36:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBB2D20274 for ; Mon, 10 Mar 2014 03:36:21 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCDAC20268 for ; Mon, 10 Mar 2014 03:36:20 +0000 (UTC) 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-0001cx-1S; 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G4zJalzF6g0lEq7JNU8+69bPldvvtFdgInQo8cGKJcc=; b=Boli2cUjmN3cZI3qWuqgUTOg8G4hAEpKeri+tCMfQbIMPnKGn75AfhMb3iVfKJF/7x KAM+XwXU2wGcug3Y2HS3wh+MkeBJmIOeiEWo8HMGZcjMYSfnmMggyHGkZ5n6yn2ludKJ j/YWg91NVnfsvd1PwOzu+eif7JAo0AvNjjVdNIjUlQqLHm4E3oEVIQEnPkIrG6yNunpO cdjni84k9J6yMJzoLXIzkKjvDfP5JWOnGP46fHNgokud40J1hbGOWScEWzqcxYpPqNov TZasLoWhd3yT2fQOCdXPvEB9lPaPCZDizM4Xb1uwtIfVDNLAJJT6XM/HWJx5bW5PVUdF GLQw== X-Gm-Message-State: ALoCoQme0Okrq6NpuqmM+eiTedyjB2EhP3R5xPoo+q5xbwDJW1mlE5cSIhkT2bgor+VVRsGf2oBs 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 (--) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 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; }