All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking
@ 2018-03-18 14:18 Heinrich Schuchardt
  2018-03-18 16:12 ` [U-Boot] [U-Boot, " Philipp Tomsich
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heinrich Schuchardt @ 2018-03-18 14:18 UTC (permalink / raw)
  To: u-boot

Pointers are never negative. Use macro IS_ERR() for checking.
cf. rk3288_mipi.c

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/video/rockchip/rk3399_mipi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c
index 9ef202bf09..7560e0c07b 100644
--- a/drivers/video/rockchip/rk3399_mipi.c
+++ b/drivers/video/rockchip/rk3399_mipi.c
@@ -128,7 +128,7 @@ static int rk_mipi_ofdata_to_platdata(struct udevice *dev)
 	struct rk_mipi_priv *priv = dev_get_priv(dev);
 
 	priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
-	if (priv->grf <= 0) {
+	if (!priv->grf || IS_ERR(priv->grf)) {
 		debug("%s: Get syscon grf failed (ret=%p)\n",
 		      __func__, priv->grf);
 		return  -ENXIO;
-- 
2.16.2

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

* [U-Boot] [U-Boot, 1/1] video: rk3399_mipi: correct error checking
  2018-03-18 14:18 [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking Heinrich Schuchardt
@ 2018-03-18 16:12 ` Philipp Tomsich
  2018-03-18 16:13 ` Philipp Tomsich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Philipp Tomsich @ 2018-03-18 16:12 UTC (permalink / raw)
  To: u-boot

> Pointers are never negative. Use macro IS_ERR() for checking.
> cf. rk3288_mipi.c
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/video/rockchip/rk3399_mipi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot, 1/1] video: rk3399_mipi: correct error checking
  2018-03-18 14:18 [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking Heinrich Schuchardt
  2018-03-18 16:12 ` [U-Boot] [U-Boot, " Philipp Tomsich
@ 2018-03-18 16:13 ` Philipp Tomsich
  2018-03-18 23:48 ` Philipp Tomsich
  2018-03-19 17:21 ` [U-Boot] [PATCH " Punit Agrawal
  3 siblings, 0 replies; 6+ messages in thread
From: Philipp Tomsich @ 2018-03-18 16:13 UTC (permalink / raw)
  To: u-boot

> Pointers are never negative. Use macro IS_ERR() for checking.
> cf. rk3288_mipi.c
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/video/rockchip/rk3399_mipi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot, 1/1] video: rk3399_mipi: correct error checking
  2018-03-18 14:18 [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking Heinrich Schuchardt
  2018-03-18 16:12 ` [U-Boot] [U-Boot, " Philipp Tomsich
  2018-03-18 16:13 ` Philipp Tomsich
@ 2018-03-18 23:48 ` Philipp Tomsich
  2018-03-19 17:21 ` [U-Boot] [PATCH " Punit Agrawal
  3 siblings, 0 replies; 6+ messages in thread
From: Philipp Tomsich @ 2018-03-18 23:48 UTC (permalink / raw)
  To: u-boot

> Pointers are never negative. Use macro IS_ERR() for checking.
> cf. rk3288_mipi.c
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  drivers/video/rockchip/rk3399_mipi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Applied to u-boot-rockchip, thanks!

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

* [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking
  2018-03-18 14:18 [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking Heinrich Schuchardt
                   ` (2 preceding siblings ...)
  2018-03-18 23:48 ` Philipp Tomsich
@ 2018-03-19 17:21 ` Punit Agrawal
  2018-03-19 17:22   ` Dr. Philipp Tomsich
  3 siblings, 1 reply; 6+ messages in thread
From: Punit Agrawal @ 2018-03-19 17:21 UTC (permalink / raw)
  To: u-boot

Heinrich Schuchardt <xypron.glpk@gmx.de> writes:

> Pointers are never negative. Use macro IS_ERR() for checking.
> cf. rk3288_mipi.c
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/video/rockchip/rk3399_mipi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c
> index 9ef202bf09..7560e0c07b 100644
> --- a/drivers/video/rockchip/rk3399_mipi.c
> +++ b/drivers/video/rockchip/rk3399_mipi.c
> @@ -128,7 +128,7 @@ static int rk_mipi_ofdata_to_platdata(struct udevice *dev)
>  	struct rk_mipi_priv *priv = dev_get_priv(dev);
>  
>  	priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
> -	if (priv->grf <= 0) {
> +	if (!priv->grf || IS_ERR(priv->grf)) {

The above two checks can be combined into IS_ERR_OR_NULL().

>  		debug("%s: Get syscon grf failed (ret=%p)\n",
>  		      __func__, priv->grf);
>  		return  -ENXIO;

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

* [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking
  2018-03-19 17:21 ` [U-Boot] [PATCH " Punit Agrawal
@ 2018-03-19 17:22   ` Dr. Philipp Tomsich
  0 siblings, 0 replies; 6+ messages in thread
From: Dr. Philipp Tomsich @ 2018-03-19 17:22 UTC (permalink / raw)
  To: u-boot

Punit,

> On 19 Mar 2018, at 18:21, Punit Agrawal <punit.agrawal@arm.com> wrote:
> 
> Heinrich Schuchardt <xypron.glpk at gmx.de <mailto:xypron.glpk@gmx.de>> writes:
> 
>> Pointers are never negative. Use macro IS_ERR() for checking.
>> cf. rk3288_mipi.c
>> 
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>> drivers/video/rockchip/rk3399_mipi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c
>> index 9ef202bf09..7560e0c07b 100644
>> --- a/drivers/video/rockchip/rk3399_mipi.c
>> +++ b/drivers/video/rockchip/rk3399_mipi.c
>> @@ -128,7 +128,7 @@ static int rk_mipi_ofdata_to_platdata(struct udevice *dev)
>> 	struct rk_mipi_priv *priv = dev_get_priv(dev);
>> 
>> 	priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
>> -	if (priv->grf <= 0) {
>> +	if (!priv->grf || IS_ERR(priv->grf)) {
> 
> The above two checks can be combined into IS_ERR_OR_NULL().

Please submit a patch and I’ll squash it onto this one.

Thanks,
Philipp.

> 
>> 		debug("%s: Get syscon grf failed (ret=%p)\n",
>> 		      __func__, priv->grf);
>> 		return  -ENXIO;

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

end of thread, other threads:[~2018-03-19 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-18 14:18 [U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking Heinrich Schuchardt
2018-03-18 16:12 ` [U-Boot] [U-Boot, " Philipp Tomsich
2018-03-18 16:13 ` Philipp Tomsich
2018-03-18 23:48 ` Philipp Tomsich
2018-03-19 17:21 ` [U-Boot] [PATCH " Punit Agrawal
2018-03-19 17:22   ` Dr. Philipp Tomsich

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.