From patchwork Tue Oct 29 02:04:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3105991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 39EE4BF924 for ; Tue, 29 Oct 2013 02:12:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E6692034A for ; Tue, 29 Oct 2013 02:12:33 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BB3E20233 for ; Tue, 29 Oct 2013 02:12:32 +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 1VaynB-0000G9-HP; Tue, 29 Oct 2013 02:12:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vayn8-0007Jq-RS; Tue, 29 Oct 2013 02:12:22 +0000 Received: from mail-bk0-x235.google.com ([2a00:1450:4008:c01::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vayn3-0007J5-4q for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2013 02:12:20 +0000 Received: by mail-bk0-f53.google.com with SMTP id d7so2086012bkh.40 for ; Mon, 28 Oct 2013 19:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=MjaUwDIOiauMKJz4lF0M0X4hHhZqR3C72Bj/qOoDblo=; b=tvz4i9tNj9w05Fr/ceNoHPjaL4KCDLcA+2Ffy4Ad/4js7yUPs4vcBNU4Yaza102P2R jNc6pklepKm8Q89hWgqETgfBLGN4HkFhc4KXDtR2beNd6x3Xo1e5ZFFC2uDN4e5rF12A JIYS5KcT6wiQJW44BYBKLRQExCh0j9lkhLkzPz+dL3on60GLvjxZzE0h/gYe2blFJwjJ /Hr6MQGEED1AfhmX6xhYPqIZfjCzNb/ZqusBNgBRZcKtVPkxEa4l5NyWqUmu9o0/Q1Gf rfK+blpmw76rijMcKe4evRjblzLRMmfO6VkyzUhE47KiGvh2iosOu+R98ukcg7H75dG1 tyJw== MIME-Version: 1.0 X-Received: by 10.205.105.73 with SMTP id dp9mr166135bkc.33.1383012252035; Mon, 28 Oct 2013 19:04:12 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Mon, 28 Oct 2013 19:04:11 -0700 (PDT) Date: Tue, 29 Oct 2013 10:04:11 +0800 Message-ID: Subject: [PATCH] ARM: spear: fix return value check in spear_setup_of_timer() From: Wei Yongjun To: viresh.linux@gmail.com, shiraz.hashim@st.com, linux@arm.linux.org.uk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131028_221217_383274_DAA13CDB X-CRM114-Status: GOOD ( 10.58 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, spear-devel@list.st.com, linux-kernel@vger.kernel.org, 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: , 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.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Wei Yongjun In case of error, the function clk_get_sys() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Acked-by: Viresh Kumar --- arch/arm/mach-spear/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index d449673..3263a34 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c @@ -222,7 +222,7 @@ void __init spear_setup_of_timer(void) } gpt_clk = clk_get_sys("gpt0", NULL); - if (!gpt_clk) { + if (IS_ERR(gpt_clk)) { pr_err("%s:couldn't get clk for gpt\n", __func__); goto err_iomap; }