All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe()
@ 2016-02-06 14:24 ` weiyj_lk at 163.com
  0 siblings, 0 replies; 4+ messages in thread
From: weiyj_lk @ 2016-02-06 14:24 UTC (permalink / raw)
  To: Jun Nie, Russell King; +Cc: Wei Yongjun, linux-arm-kernel, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
index e08574d..2037bcb 100644
--- a/arch/arm/mach-zx/zx296702-pm-domain.c
+++ b/arch/arm/mach-zx/zx296702-pm-domain.c
@@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
 	}
 
 	pcubase = devm_ioremap_resource(&pdev->dev, res);
-	if (!pcubase) {
+	if (IS_ERR(pcubase)) {
 		dev_err(&pdev->dev, "ioremap fail.\n");
-		return -EIO;
+		return PTR_ERR(pcubase);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe()
@ 2016-02-06 14:24 ` weiyj_lk at 163.com
  0 siblings, 0 replies; 4+ messages in thread
From: weiyj_lk at 163.com @ 2016-02-06 14:24 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
index e08574d..2037bcb 100644
--- a/arch/arm/mach-zx/zx296702-pm-domain.c
+++ b/arch/arm/mach-zx/zx296702-pm-domain.c
@@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
 	}
 
 	pcubase = devm_ioremap_resource(&pdev->dev, res);
-	if (!pcubase) {
+	if (IS_ERR(pcubase)) {
 		dev_err(&pdev->dev, "ioremap fail.\n");
-		return -EIO;
+		return PTR_ERR(pcubase);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe()
  2016-02-06 14:24 ` weiyj_lk at 163.com
@ 2016-02-09  5:02   ` Jun Nie
  -1 siblings, 0 replies; 4+ messages in thread
From: Jun Nie @ 2016-02-09  5:02 UTC (permalink / raw)
  To: weiyj_lk, Russell King; +Cc: Wei Yongjun, linux-arm-kernel, linux-kernel

On 2016年02月06日 22:24, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_resource() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>   arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
> index e08574d..2037bcb 100644
> --- a/arch/arm/mach-zx/zx296702-pm-domain.c
> +++ b/arch/arm/mach-zx/zx296702-pm-domain.c
> @@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
>   	}
>
>   	pcubase = devm_ioremap_resource(&pdev->dev, res);
> -	if (!pcubase) {
> +	if (IS_ERR(pcubase)) {
>   		dev_err(&pdev->dev, "ioremap fail.\n");
> -		return -EIO;
> +		return PTR_ERR(pcubase);
>   	}
>
>   	for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)
>

Thanks for fixing this issue.
Reviewed-by: Jun Nie <jun.nie@linaro.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe()
@ 2016-02-09  5:02   ` Jun Nie
  0 siblings, 0 replies; 4+ messages in thread
From: Jun Nie @ 2016-02-09  5:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 2016?02?06? 22:24, weiyj_lk at 163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function devm_ioremap_resource() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>   arch/arm/mach-zx/zx296702-pm-domain.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
> index e08574d..2037bcb 100644
> --- a/arch/arm/mach-zx/zx296702-pm-domain.c
> +++ b/arch/arm/mach-zx/zx296702-pm-domain.c
> @@ -169,9 +169,9 @@ static int zx296702_pd_probe(struct platform_device *pdev)
>   	}
>
>   	pcubase = devm_ioremap_resource(&pdev->dev, res);
> -	if (!pcubase) {
> +	if (IS_ERR(pcubase)) {
>   		dev_err(&pdev->dev, "ioremap fail.\n");
> -		return -EIO;
> +		return PTR_ERR(pcubase);
>   	}
>
>   	for (i = 0; i < ARRAY_SIZE(zx296702_pm_domains); ++i)
>

Thanks for fixing this issue.
Reviewed-by: Jun Nie <jun.nie@linaro.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-09  5:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-06 14:24 [PATCH] ARM: zx: Fix return value check in zx296702_pd_probe() weiyj_lk
2016-02-06 14:24 ` weiyj_lk at 163.com
2016-02-09  5:02 ` Jun Nie
2016-02-09  5:02   ` Jun Nie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.