Skip to contentSkip to conversation

clk: mxl: Fix smatch static checker warning

PATCH Applied Rahul Tanwar 2 participants 3 messages Oct 25, 2022 – Oct 27, 2022 Common clk

lore
Share & tools
lore
#0 lore raw

cover clk: mxl: Fix smatch static checker warning

Fix the static checker warning reported by Dan Carpenter.

The patch is created on top of clk-next branch of below clk git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next

Rahul Tanwar (1):
clk: mxl: Fix smatch static checker warning

 drivers/clk/x86/clk-lgm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 clk: mxl: Fix smatch static checker warning

Commit 036177310bac: ("clk: mxl: Switch from direct readl/writel based IO to regmap based IO") introduced code resulting in below warning issued by the smatch static checker.

drivers/clk/x86/clk-lgm.c:441 lgm_cgu_probe()
warn: passing zero to 'PTR_ERR'

Fix the warning by replacing incorrect IS_ERR_OR_NULL() with IS_ERR().

Fixes 036177310bac: ("clk: mxl: Switch from direct readl/writel based IO to

regmap based IO")

---
 drivers/clk/x86/clk-lgm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/x86/clk-lgm.c +1 -1
index 4de77b2c750d..f69455dd1c98 100644
@@ -436,7 +436,7 @@ static int lgm_cgu_probe(struct platform_device *pdev)
 	ctx->clk_data.num = CLK_NR_CLKS;
 
 	ctx->membase = syscon_node_to_regmap(np);
-	if (IS_ERR_OR_NULL(ctx->membase)) {
+	if (IS_ERR(ctx->membase)) {
 		dev_err(dev, "Failed to get clk CGU iomem\n");
 		return PTR_ERR(ctx->membase);
 	}
Signature · 1 line
2.17.1
maintainer Applied
#2 lore raw

Quoting Rahul Tanwar (2022-10-25 04:03:57)

Quoted 7 lines

Commit 036177310bac: ("clk: mxl: Switch from direct readl/writel based IO to regmap based IO") introduced code resulting in below warning issued by the smatch static checker.

drivers/clk/x86/clk-lgm.c:441 lgm_cgu_probe()
warn: passing zero to 'PTR_ERR'

Quoted 7 lines

Fix the warning by replacing incorrect IS_ERR_OR_NULL() with IS_ERR().

Fixes 036177310bac: ("clk: mxl: Switch from direct readl/writel based IO to

regmap based IO")

---

Applied to clk-next

BTW, please don't send a cover letter for single patches.