From patchwork Fri Mar 22 17:21:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 2321851 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AD4E63FD8C for ; Fri, 22 Mar 2013 17:24:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJ5f2-0006FJ-E7; Fri, 22 Mar 2013 17:21:48 +0000 Received: from mail-pd0-f181.google.com ([209.85.192.181]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJ5ey-0006Du-7S for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2013 17:21:44 +0000 Received: by mail-pd0-f181.google.com with SMTP id q10so1691265pdj.40 for ; Fri, 22 Mar 2013 10:21:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:content-type:mime-version:content-transfer-encoding:to :from:in-reply-to:cc:references:message-id:user-agent:subject:date :x-gm-message-state; bh=C18JYlT9V9Qtt1j2gjLLAl2y0eTOdtQKV4CjSG8eJaI=; b=Q11puBnl1VYRyCWDCYVtXgkxn/GKkRtcSNJdcWASEpccb4sbN32frR5OYGJgBNk/gB kAT2qJsZBI5Npem48Bc6h57G8ex9hC0yWvSC1b2BdLdAUa9dyACo9NKPvOVngjx5gLq0 8o3StMIZP9u1nPk0lS+o0gaHN6Mk1PGNYnzdLbjm0NV8+OqIphgJnXuRRvHZrvGFhDqU 5WAtMmACjnTFxeBU3LxGoD6DOMuqAXOZXXHYjOLZ81j4tbSkK9H5BQgTX6uo7VM3LVeL AsIWGMzd/fudvWnLrQywvf51AYA+hQCv+mZPSu/+056k5Y0xa8JiIsU0nPgh/p+lXK1t qGgQ== X-Received: by 10.66.176.43 with SMTP id cf11mr4524314pac.28.1363972902136; Fri, 22 Mar 2013 10:21:42 -0700 (PDT) Received: from localhost (adsl-69-228-93-79.dsl.pltn13.pacbell.net. [69.228.93.79]) by mx.google.com with ESMTPS id ef3sm3680131pad.20.2013.03.22.10.21.39 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 22 Mar 2013 10:21:41 -0700 (PDT) MIME-Version: 1.0 To: Wei Yongjun , Baohua.Song@csr.com From: Mike Turquette In-Reply-To: References: Message-ID: <20130322172137.834.44023@quantum> User-Agent: alot/0.3.3+ Subject: Re: [PATCH] clk: prima2: fix return value check in sirfsoc_of_clk_init() Date: Fri, 22 Mar 2013 10:21:37 -0700 X-Gm-Message-State: ALoCoQm+dsPa0fvEeRAgkiQdow+ZSsd1oaUUVSEh4yClpev89pns8dvUXKfjEfqvnn5HPaoyjlvv X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130322_132144_378034_E8E4C025 X-CRM114-Status: GOOD ( 13.85 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.181 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: yongjun_wei@trendmicro.com.cn, 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 Quoting Wei Yongjun (2013-03-11 08:55:18) > From: Wei Yongjun > > In case of error, the function clk_get() returns ERR_PTR() > not NULL. The NULL test in the return value check should > be replaced with IS_ERR(). > > Signed-off-by: Wei Yongjun > --- > drivers/clk/clk-prima2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c > index f8e9d0c..b208665 100644 > --- a/drivers/clk/clk-prima2.c > +++ b/drivers/clk/clk-prima2.c > @@ -1113,7 +1113,7 @@ void __init sirfsoc_of_clk_init(void) > > for (i = pll1; i < maxclk; i++) { > prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]); > - BUG_ON(!prima2_clks[i]); > + BUG_ON(IS_ERR(prima2_clks[i]); > } > clk_register_clkdev(prima2_clks[cpu], NULL, "cpu"); > clk_register_clkdev(prima2_clks[io], NULL, "io"); This patch failed to compile. Fix is below and applied to clk-next. Let me know if you have any issue with it: Regards, Mike diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c index b208665..643ca65 100644 --- a/drivers/clk/clk-prima2.c +++ b/drivers/clk/clk-prima2.c @@ -1113,7 +1113,7 @@ void __init sirfsoc_of_clk_init(void) for (i = pll1; i < maxclk; i++) { prima2_clks[i] = clk_register(NULL, prima2_clk_hw_array[i]); - BUG_ON(IS_ERR(prima2_clks[i]); + BUG_ON(IS_ERR(prima2_clks[i])); } clk_register_clkdev(prima2_clks[cpu], NULL, "cpu"); clk_register_clkdev(prima2_clks[io], NULL, "io");