lkml.org 
[lkml]   [2020]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] extcon: remove redundant assignment to variable idx
From
Date
On 4/16/20 8:08 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable idx is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/extcon/extcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 2dfbfec572f9..0a6438cbb3f3 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -900,7 +900,7 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
> struct notifier_block *nb)
> {
> unsigned long flags;
> - int ret, idx = -EINVAL;
> + int ret, idx;
>
> if (!edev || !nb)
> return -EINVAL;
>

Applied it. Thanks.

--
Best Regards,
Chanwoo Choi
Samsung Electronics

\
 
 \ /
  Last update: 2020-04-17 04:57    [W:0.047 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site