Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737976 > unrolled thread

[PATCH] staging: greybus: light: remove unnecessary error check

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-09-23 10:10 +0200
Last post2017-09-25 16:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: greybus: light: remove unnecessary error check Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-09-23 10:10 +0200
    Re: [PATCH] staging: greybus: light: remove unnecessary error check Rui Miguel Silva <rmfrfs@gmail.com> - 2017-09-25 16:30 +0200

#1737976 — [PATCH] staging: greybus: light: remove unnecessary error check

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-09-23 10:10 +0200
Subject[PATCH] staging: greybus: light: remove unnecessary error check
Message-ID<usNFD-Ay-1@gated-at.bofh.it>
It is not necessary to check return value of gb_lights_channel_flash_config.
gb_lights_channel_config returns both successful and error value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/staging/greybus/light.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 0f538b8..d7da475 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -1000,11 +1000,7 @@ static int gb_lights_channel_config(struct gb_light *light,
 
 	light->has_flash = true;
 
-	ret = gb_lights_channel_flash_config(channel);
-	if (ret < 0)
-		return ret;
-
-	return ret;
+	return gb_lights_channel_flash_config(channel);
 }
 
 static int gb_lights_light_config(struct gb_lights *glights, u8 id)
-- 
2.7.4

[toc] | [next] | [standalone]


#1739090

FromRui Miguel Silva <rmfrfs@gmail.com>
Date2017-09-25 16:30 +0200
Message-ID<utCyu-7ys-21@gated-at.bofh.it>
In reply to#1737976
Hi,
On Sat, Sep 23, 2017 at 01:39:15PM +0530, Arvind Yadav wrote:
> It is not necessary to check return value of gb_lights_channel_flash_config.
> gb_lights_channel_config returns both successful and error value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Thanks for the patch.
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

---
Cheers,
	Rui

> ---
>  drivers/staging/greybus/light.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
> index 0f538b8..d7da475 100644
> --- a/drivers/staging/greybus/light.c
> +++ b/drivers/staging/greybus/light.c
> @@ -1000,11 +1000,7 @@ static int gb_lights_channel_config(struct gb_light *light,
>  
>  	light->has_flash = true;
>  
> -	ret = gb_lights_channel_flash_config(channel);
> -	if (ret < 0)
> -		return ret;
> -
> -	return ret;
> +	return gb_lights_channel_flash_config(channel);
>  }
>  
>  static int gb_lights_light_config(struct gb_lights *glights, u8 id)
> -- 
> 2.7.4
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web