Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: clk-xgene: Adjust six checks for null pointers

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 <elfring@users.sourceforge.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Markus Elfring and committed by
Stephen Boyd
62c73ed5 e335545f

+6 -6
+6 -6
drivers/clk/clk-xgene.c
··· 189 189 int version = xgene_pllclk_version(np); 190 190 191 191 reg = of_iomap(np, 0); 192 - if (reg == NULL) { 192 + if (!reg) { 193 193 pr_err("Unable to map CSR register for %pOF\n", np); 194 194 return; 195 195 } ··· 465 465 if (pclk->lock) 466 466 spin_lock_irqsave(pclk->lock, flags); 467 467 468 - if (pclk->param.csr_reg != NULL) { 468 + if (pclk->param.csr_reg) { 469 469 pr_debug("%s clock enabled\n", clk_hw_get_name(hw)); 470 470 /* First enable the clock */ 471 471 data = xgene_clk_read(pclk->param.csr_reg + ··· 505 505 if (pclk->lock) 506 506 spin_lock_irqsave(pclk->lock, flags); 507 507 508 - if (pclk->param.csr_reg != NULL) { 508 + if (pclk->param.csr_reg) { 509 509 pr_debug("%s clock disabled\n", clk_hw_get_name(hw)); 510 510 /* First put the CSR in reset */ 511 511 data = xgene_clk_read(pclk->param.csr_reg + ··· 531 531 struct xgene_clk *pclk = to_xgene_clk(hw); 532 532 u32 data = 0; 533 533 534 - if (pclk->param.csr_reg != NULL) { 534 + if (pclk->param.csr_reg) { 535 535 pr_debug("%s clock checking\n", clk_hw_get_name(hw)); 536 536 data = xgene_clk_read(pclk->param.csr_reg + 537 537 pclk->param.reg_clk_offset); ··· 540 540 "disabled"); 541 541 } 542 542 543 - if (pclk->param.csr_reg == NULL) 543 + if (!pclk->param.csr_reg) 544 544 return 1; 545 545 return data & pclk->param.reg_clk_mask ? 1 : 0; 546 546 } ··· 705 705 break; 706 706 } 707 707 map_res = of_iomap(np, i); 708 - if (map_res == NULL) { 708 + if (!map_res) { 709 709 pr_err("Unable to map resource %d for %pOF\n", i, np); 710 710 goto err; 711 711 }