mtd: s3c2410 nand: Remove uncessary null check
Subsystems (3)
PATCH 1/1 mtd: s3c2410 nand: Remove uncessary null check
From: Jonghwan Choi <[email protected]>
clk_get() return a pointer to the struct clk or an ERR_PTR().
--- drivers/mtd/nand/s3c2410.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/nand/s3c2410.c +1 -1
@@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)/* free the common resources */ -if (info->clk !=NULL && !IS_ERR (info->clk)) { +if (!IS_ERR (info->clk)) {s3c2410_nand_clk_set_state (info,CLOCK_DISABLE );clk_put (info->clk); }
Signature · 1 line
1.7.0
PATCH 1/1 mtd: s3c2410 nand: Remove uncessary null check
Quoted 14 lines · jhbird.choi at samsung.com
From: Jonghwan Choi <[email protected]>
clk_get()return a pointer to the struct clk or anERR_PTR().Signed-off-by Jonghwan Choi <[email protected]>--- drivers/mtd/nand/s3c2410.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mtd/nand/s3c2410.c +0
-0
drivers/mtd/nand/s3c2410.c static int s3c24xx_nand_remove(struct platform_device *pdev) · line 726
Quoted 5 lines
drivers/mtd/nand/s3c2410.c +1
-1@@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)/* free the common resources */ -if (info->clk !=NULL && !IS_ERR (info->clk)) { +if (!IS_ERR (info->clk)) {
I think you should use IS_ERR_OR_NULL instead.
Quoted 3 lines
drivers/mtd/nand/s3c2410.c +0
-0s3c2410_nand_clk_set_state (info,CLOCK_DISABLE );clk_put (info->clk); }
PATCH 1/1 mtd: s3c2410 nand: Remove uncessary null check
Quoted 16 lines · Varun Wadekar
Quoted 15 lines · jhbird.choi at samsung.com
From: Jonghwan Choi <[email protected]>
clk_get()return a pointer to the struct clk or anERR_PTR().Signed-off-by Jonghwan Choi <[email protected]>--- drivers/mtd/nand/s3c2410.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/mtd/nand/s3c2410.c +0
-0@@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
Quoted 6 lines
drivers/mtd/nand/s3c2410.c static int s3c24xx_nand_remove(struct platform_device *pdev) · line 726
Quoted 4 lines
drivers/mtd/nand/s3c2410.c +1
-1/* free the common resources */ -if (info->clk !=NULL && !IS_ERR (info->clk)) { +if (!IS_ERR (info->clk)) {I think you should use
IS_ERR_OR_NULLinstead.
No. Jonghwan Choi's patch is correct.
As per the patch description, the only error value which a driver can attribute any problem with is something which passes IS_ERR(). Everything else the driver must treat as a _valid_ struct clk - and the clk API implementation must accept non-IS_ERR() clk_get() values.
Artem Bityutskiy
AppliedPATCH 1/1 mtd: s3c2410 nand: Remove uncessary null check
In reply to jhbird.choi at samsung.comQuoted 5 lines · jhbird.choi at samsung.com
From: Jonghwan Choi <[email protected]>
clk_get()return a pointer to the struct clk or anERR_PTR().Signed-off-by Jonghwan Choi <[email protected]>
Pushed to l2-mtd-2.6.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy