Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031969AbdIZTmb (ORCPT ); Tue, 26 Sep 2017 15:42:31 -0400 Received: from mout.web.de ([212.227.17.12]:63257 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966176AbdIZTm3 (ORCPT ); Tue, 26 Sep 2017 15:42:29 -0400 Subject: [PATCH 2/2] clk-xgene: Adjust six checks for null pointers From: SF Markus Elfring To: linux-clk@vger.kernel.org, Loc Ho , Michael Turquette , Stephen Boyd Cc: LKML , kernel-janitors@vger.kernel.org References: <1440d17a-ae7d-0a9c-49b4-611824df5e87@users.sourceforge.net> Message-ID: Date: Tue, 26 Sep 2017 21:42:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1440d17a-ae7d-0a9c-49b4-611824df5e87@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:5phb2A3FxIxjTvfUzbo6C/zmzWbnXHzEdjPcCc4wchxTQJ9r990 SZ1dMweGgMmALsRNHR53/umobiKRis0y0jcl6DNkY4gOGlC2VhGSc8UKld0u5yDTjmRvh9S 9N4WGSb3RknDHoS38TZSG/okxXtIgZgQU9Kx4YdmTdGMK8gWhqHBx5uOfhL1bmsFCBx/+kV s8SK1IihpvbaQ3Z8m7m8A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Zm6Mhuaejko=:Vp58PwVHqLfXLzGB1t0bH4 G1rqRY0Tx/zekxvaarFE2hN244fmwS4Qs8s6dq13GyOfl4pGcn843vvUWOQtRO9K5T1RLhlPL RewLf3h8IwjOUUPcvxssFVwmYZ2J5/JEuCa5l7uND3F2jDN0dxCRxfnFxmzRbDxb6nKyPCyP/ qvZEelVJSthbwk8PJWcwegba3FFw5uAKPugXQnTArYn6jTZF04OffANep8r0cRQxYcH5Qf5zH tzAoMzPXBnVr/tSya23ZzZWSYcIkMH6o8A46E9zjDrSf6NCKM5FYXxKTRv2vAz7cZ08Tljzi3 lEyG2kq/Hys42lu/hw6WrY50LrdNNkiP3QLQRTUlk9wgWgZwYCzIHhMmjMRrhUEDAImVAnyHN dPpF2iyTsyOs97gnaaoEUqqXICnVlvArb7GBS94i0EUmIuhrL08quSMw8X5NzfyUBS5I9x/Ow bHWazlF7JcCkoRtgqrWZAVTg8KbW66/adUE4e0n0D4mSsHpcD0cPPfWouxHsQvv5VZX2dVywY 2DfJntCDhYoMRooM84iS5QbaQfjPSErcwhOxJvaBHr3Vp2UyQh8b/bbJ65I8cO8FH+xh6LUkj l1XTXK6nzuebdY53wNWv43Fk5ULZI/W+SSGeqFnjZTlH7MhMY9Uto+dwQO2Wb8bnH0kmNPifh gDcLhWvGdFaGRF/LrnZJ8hTIS9l6Zw+NcOv2U8KuWhB6MzcrJTssuCf2XtUXPTWP1ztQrAhFz XOAqVQo7/Fm9QuwGNyQHknuxarFoNbP5+fkVDpJX2Fatf2Yn4vxbU7nVYxPn4gKF99taDbBSv BNFqflCHu1+9pd1ofEscb5gHgk24wj4A8H/n3nCM+AKjVGR89w= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2432 Lines: 77 From: Markus Elfring Date: Tue, 26 Sep 2017 21:27:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/clk/clk-xgene.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c index 3cc84a65f686..531b030d4d4e 100644 --- a/drivers/clk/clk-xgene.c +++ b/drivers/clk/clk-xgene.c @@ -189,7 +189,7 @@ static void xgene_pllclk_init(struct device_node *np, enum xgene_pll_type pll_ty int version = xgene_pllclk_version(np); reg = of_iomap(np, 0); - if (reg == NULL) { + if (!reg) { pr_err("Unable to map CSR register for %pOF\n", np); return; } @@ -465,7 +465,7 @@ static int xgene_clk_enable(struct clk_hw *hw) if (pclk->lock) spin_lock_irqsave(pclk->lock, flags); - if (pclk->param.csr_reg != NULL) { + if (pclk->param.csr_reg) { pr_debug("%s clock enabled\n", clk_hw_get_name(hw)); /* First enable the clock */ data = xgene_clk_read(pclk->param.csr_reg + @@ -505,7 +505,7 @@ static void xgene_clk_disable(struct clk_hw *hw) if (pclk->lock) spin_lock_irqsave(pclk->lock, flags); - if (pclk->param.csr_reg != NULL) { + if (pclk->param.csr_reg) { pr_debug("%s clock disabled\n", clk_hw_get_name(hw)); /* First put the CSR in reset */ data = xgene_clk_read(pclk->param.csr_reg + @@ -531,7 +531,7 @@ static int xgene_clk_is_enabled(struct clk_hw *hw) struct xgene_clk *pclk = to_xgene_clk(hw); u32 data = 0; - if (pclk->param.csr_reg != NULL) { + if (pclk->param.csr_reg) { pr_debug("%s clock checking\n", clk_hw_get_name(hw)); data = xgene_clk_read(pclk->param.csr_reg + pclk->param.reg_clk_offset); @@ -540,7 +540,7 @@ static int xgene_clk_is_enabled(struct clk_hw *hw) "disabled"); } - if (pclk->param.csr_reg == NULL) + if (!pclk->param.csr_reg) return 1; return data & pclk->param.reg_clk_mask ? 1 : 0; } @@ -705,7 +705,7 @@ static void __init xgene_devclk_init(struct device_node *np) break; } map_res = of_iomap(np, i); - if (map_res == NULL) { + if (!map_res) { pr_err("Unable to map resource %d for %pOF\n", i, np); goto err; } -- 2.14.1