Skip to content

Commit 6a636d2

Browse files
committed
clk: renesas: Use IS_ERR() for pointers that cannot be NULL
The use of IS_ERR_OR_NULL() suggests that "clk" can be a NULL pointer. Hence smatch assumes so, and issues a "passing zero to 'PTR_ERR'" warning. At these checkpoints, "clk" always contains either a valid pointer, or an error pointer (none of the functions called return NULL pointers). Hence replace IS_ERR_OR_NULL() by IS_ERR(). Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202408032025.ve2JMaoV-lkp@intel.com/ Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://patch.msgid.link/81260328acb5c78e915ab04afad3901a31c16128.1758793709.git.geert+renesas@glider.be
1 parent 06e6ea3 commit 6a636d2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/clk/renesas/renesas-cpg-mssr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static void __init cpg_mssr_register_core_clk(const struct cpg_core_clk *core,
451451
break;
452452
}
453453

454-
if (IS_ERR_OR_NULL(clk))
454+
if (IS_ERR(clk))
455455
goto fail;
456456

457457
dev_dbg(dev, "Core clock %pC at %lu Hz\n", clk, clk_get_rate(clk));

drivers/clk/renesas/rzg2l-cpg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ rzg2l_cpg_register_core_clk(const struct cpg_core_clk *core,
11771177
goto fail;
11781178
}
11791179

1180-
if (IS_ERR_OR_NULL(clk))
1180+
if (IS_ERR(clk))
11811181
goto fail;
11821182

11831183
dev_dbg(dev, "Core clock %pC at %lu Hz\n", clk, clk_get_rate(clk));

drivers/clk/renesas/rzv2h-cpg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ rzv2h_cpg_register_core_clk(const struct cpg_core_clk *core,
591591
goto fail;
592592
}
593593

594-
if (IS_ERR_OR_NULL(clk))
594+
if (IS_ERR(clk))
595595
goto fail;
596596

597597
dev_dbg(dev, "Core clock %pC at %lu Hz\n", clk, clk_get_rate(clk));

0 commit comments

Comments
 (0)