clk: sunxi: fix devm_ioremap_resource error detection code
PATCH 1/1 clk: sunxi: fix devm_ioremap_resource error detection code
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
A simplified version of the semantic match that finds this problem is as follows:
// <smpl>
@@
expression e,e1;
statement S;
@@
*e = devm_ioremap_resource(...);
if (!e1) S
// </smpl>
--- drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -1
@@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (&pdev->dev, r); -if (!reg) +if (IS_ERR (reg))return PTR_ERR (reg); clk_parent =of_clk_get_parent_name (np,0 );
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Emilio López
maintainerHi,
El 28/06/14 14:58, Boris BREZILLON escribi?:
Quoted 36 lines
Hello,
Quoted 33 lines · Himangi Saraogi
devm_ioremap_resourcereturns anERR_PTRvalue, not NULL, on failure.A simplified version of the semantic match that finds this problem is as follows:
// <smpl>
@@
expression e,e1;
statement S;
@@*e =
devm_ioremap_resource(...);
if (!e1) S// </smpl>
Signed-off-by Himangi Saraogi<[email protected]>Acked-by Julia Lawall<[email protected]>--- drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1
-1@@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (&pdev->dev, r); -if (!reg) +if (IS_ERR (reg))return PTR_ERR (reg);
Quoted 8 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) · line 35
Quoted 1 line
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0
-0clk_parent =of_clk_get_parent_name (np,0 );Oops, one more mistake in testing
devm_ioremap_resourcereturn code (I always mixdevm_ioremap_resourceanddevm_request_and_ioremapbehaviours).Sorry for the inconvenience, and of course, you have my:
Acked-by Boris BREZILLON <[email protected]>
Mike, do you want to take this directly for the -rc cycle, or should I queue it for 3.17? Please let me know.
Cheers,
Emilio
Quoting Emilio L?pez (2014-06-28 14:38:26)
Quoted 44 lines
Hi,
El 28/06/14 14:58, Boris BREZILLON escribi?:
Quoted 41 lines
Hello,
Quoted 26 lines · Himangi Saraogi
devm_ioremap_resourcereturns anERR_PTRvalue, not NULL, on failure.A simplified version of the semantic match that finds this problem is as follows:
// <smpl>
@@
expression e,e1;
statement S;
@@*e =
devm_ioremap_resource(...);
if (!e1) S// </smpl>
Signed-off-by Himangi Saraogi<[email protected]>Acked-by Julia Lawall<[email protected]>--- drivers/clk/sunxi/clk-sun6i-apb0-gates.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/sunxi/clk-sun6i-apb0-gates.c +0
-0drivers/clk/sunxi/clk-sun6i-apb0-gates.c static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) · line 35
Quoted 8 lines
drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1
-1@@ -29,7 +29,7 @@ static int sun6i_a31_apb0_gates_clk_probe(struct platform_device *pdev) r =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (&pdev->dev, r); -if (!reg) +if (IS_ERR (reg))return PTR_ERR (reg); clk_parent =of_clk_get_parent_name (np,0 );Oops, one more mistake in testing
devm_ioremap_resourcereturn code (I always mixdevm_ioremap_resourceanddevm_request_and_ioremapbehaviours).
Quoted 6 lines
Quoted 3 lines
Sorry for the inconvenience, and of course, you have my:
Acked-by Boris BREZILLON <[email protected]>
Mike, do you want to take this directly for the -rc cycle, or should I queue it for 3.17? Please let me know.
I've picked it for the current -rc cycle.
Thanks,
Mike
Quoted 4 lines
Cheers,
Emilio