linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] extcon: sm5502: remove redundant assignment to variable cable_type
@ 2019-10-25 13:12 ` Colin King
  2019-10-31  4:48   ` Chanwoo Choi
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-10-25 13:12 UTC (permalink / raw)
  To: MyungJoo Ham, Chanwoo Choi; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable cable_type is being initialized with a value that
is never read and is being re-assigned a little later on. The
assignment is redundant and hence can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/extcon/extcon-sm5502.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
index b3d93baf4fc5..bcf65aaca5d2 100644
--- a/drivers/extcon/extcon-sm5502.c
+++ b/drivers/extcon/extcon-sm5502.c
@@ -276,7 +276,7 @@ static int sm5502_muic_set_path(struct sm5502_muic_info *info,
 /* Return cable type of attached or detached accessories */
 static unsigned int sm5502_muic_get_cable_type(struct sm5502_muic_info *info)
 {
-	unsigned int cable_type = -1, adc, dev_type1;
+	unsigned int cable_type, adc, dev_type1;
 	int ret;
 
 	/* Read ADC value according to external cable or button */
-- 
2.20.1


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

* Re: [PATCH] extcon: sm5502: remove redundant assignment to variable cable_type
  2019-10-25 13:12 ` [PATCH] extcon: sm5502: remove redundant assignment to variable cable_type Colin King
@ 2019-10-31  4:48   ` Chanwoo Choi
  0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2019-10-31  4:48 UTC (permalink / raw)
  To: Colin King, MyungJoo Ham; +Cc: kernel-janitors, linux-kernel

On 19. 10. 25. 오후 10:12, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable cable_type is being initialized with a value that
> is never read and is being re-assigned a little later on. The
> assignment is redundant and hence can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/extcon/extcon-sm5502.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
> index b3d93baf4fc5..bcf65aaca5d2 100644
> --- a/drivers/extcon/extcon-sm5502.c
> +++ b/drivers/extcon/extcon-sm5502.c
> @@ -276,7 +276,7 @@ static int sm5502_muic_set_path(struct sm5502_muic_info *info,
>  /* Return cable type of attached or detached accessories */
>  static unsigned int sm5502_muic_get_cable_type(struct sm5502_muic_info *info)
>  {
> -	unsigned int cable_type = -1, adc, dev_type1;
> +	unsigned int cable_type, adc, dev_type1;
>  	int ret;
>  
>  	/* Read ADC value according to external cable or button */
> 

Applied it. Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

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

end of thread, other threads:[~2019-10-31  4:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20191025131232epcas4p262cce6ea441f3f1b9251810ad9427732@epcas4p2.samsung.com>
2019-10-25 13:12 ` [PATCH] extcon: sm5502: remove redundant assignment to variable cable_type Colin King
2019-10-31  4:48   ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).