ACK: [PATCH] lib: fwts_ac_adapter: remove redundant pointer ac_entry

Alex Hung alex.hung at canonical.com
Thu Apr 29 00:48:56 UTC 2021


On 2021-04-28 4:07 p.m., Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> Pointer ac_entry is being assigned but the value is never read, it
> is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_ac_adapter.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/lib/src/fwts_ac_adapter.c b/src/lib/src/fwts_ac_adapter.c
> index b164f822..6042883a 100644
> --- a/src/lib/src/fwts_ac_adapter.c
> +++ b/src/lib/src/fwts_ac_adapter.c
> @@ -78,10 +78,9 @@ int fwts_ac_adapter_get_state(const int state, int *matching, int *not_matching)
>  
>  	/* Try to user newer /sys interface first */
>  	if ((ac_power_dir = opendir(FWTS_SYS_CLASS_POWER_SUPPLY))) {
> -		struct dirent *ac_entry;
>  		int count = 0;
>  
> -		while ((ac_entry = readdir(ac_power_dir)) != NULL)
> +		while (readdir(ac_power_dir) != NULL)
>  			count++;
>  
>  		/* no power supply dir exists */
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list