Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp678338ybh; Sun, 12 Jul 2020 20:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5PyuuIFw65uNttmysjU6weVJTE14OUhkXScQmyviC+q7AhbpBgTgmO5VIBdKrafWTKhfl X-Received: by 2002:a17:906:b353:: with SMTP id cd19mr65058998ejb.395.1594610564685; Sun, 12 Jul 2020 20:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594610564; cv=none; d=google.com; s=arc-20160816; b=vAGozqp0Kci6pQoTxnaMbwEpGWPbQaChxVmGtMicxj9kpI9xEaGI51fK7vWi0wx9dB F4d3NqY0gd2JFDdFNChkhFxbZlFy8SjBTq/PEWupXH027JFZRskXOt1bxevcr83k9iDR i0MNz3Is6XtfiUEH15GdtpuHav/KQoUbECRxvzrpSLKEgRDhqi2r3DDrOeGrj5WjqU0/ UkgeJOo2fDSbwI6YVoWFSpkLYfNAo8QEQ+jvbfcwQBacMLvgkho6iqzTZUkK1Xdk6bd7 CHCRaVmJ/N9ChlBL2H089APTD7g1cXlHcl/c8pFE2ZrlHVYujtBzw/+L+t0br9SIzJI+ QNgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=w3it+tjcwdM3xBrGKEWbK9HLjhsMbuHWQ/3crLAVeDY=; b=QD9FMIXFquClggSx2L+oW/wk309PgrNqGCj17bHgKeoCuEHP1eD6PGQE3FkIE388iy scyXl/xPzYXoTPt9oZIes6BdHmDcVojWLTEVT4h4IiFovH2I74buOUbp4l7UfQfSAErY RPudkxGIKWcxfcy1ZoaMp/h7ZAwPmozIcwWK5Zjd12rzEoLlri1h3MqeDz/CkYmHnjB5 yk5oBRD/dA+aVW9+uqcVCNha0zGjkr1T90zInv8zIq1tRVahcSacHgMtuGYU3tnm39hF JW9ZJy2z0KRk3GEFcVIcfxjCSaxz4ybqfwoI5/6rxcvqmt6tQ3AHJv6PQ/7MQVPi8Mcp CbAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si8784445eds.485.2020.07.12.20.22.22; Sun, 12 Jul 2020 20:22:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbgGMDV4 (ORCPT + 99 others); Sun, 12 Jul 2020 23:21:56 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:43320 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726261AbgGMDV4 (ORCPT ); Sun, 12 Jul 2020 23:21:56 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-01 (Coremail) with SMTP id qwCowAAHT5tI0wtft15aAA--.63616S2; Mon, 13 Jul 2020 11:21:45 +0800 (CST) From: Xu Wang To: mturquette@baylibre.com, sboyd@kernel.org, baohua@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Xu Wang Subject: [PATCH] clk: clk-atlas6: fix return value check in atlas6_clk_init() Date: Mon, 13 Jul 2020 03:21:43 +0000 Message-Id: <20200713032143.21362-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: qwCowAAHT5tI0wtft15aAA--.63616S2 X-Coremail-Antispam: 1UD129KBjvdXoW7JrW7WFykXF48ZFWrurWrGrg_yoWfWwcEgF 4rKFnxXw1rCw1SyrW5Aa4xZryFvFn5ur4xZa4xKFsxJa48WrykWFZIv34DAr9rKrWkJryD tw1kGryfCw1akjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4xFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26F4UJV W0owAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAFwI0_Gr1j6F4UJwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 GwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUf-B_UUU UU= X-Originating-IP: [159.226.5.99] X-CM-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiAw0QA13qZNmYiQAAsG Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function clk_register() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Xu Wang --- drivers/clk/sirf/clk-atlas6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/sirf/clk-atlas6.c b/drivers/clk/sirf/clk-atlas6.c index c84d5bab7ac2..b95483bb6a5e 100644 --- a/drivers/clk/sirf/clk-atlas6.c +++ b/drivers/clk/sirf/clk-atlas6.c @@ -135,7 +135,7 @@ static void __init atlas6_clk_init(struct device_node *np) for (i = pll1; i < maxclk; i++) { atlas6_clks[i] = clk_register(NULL, atlas6_clk_hw_array[i]); - BUG_ON(!atlas6_clks[i]); + BUG_ON(IS_ERR(atlas6_clks[i])); } clk_register_clkdev(atlas6_clks[cpu], NULL, "cpu"); clk_register_clkdev(atlas6_clks[io], NULL, "io"); -- 2.17.1