ACK: [PATCH] acpi: cstates: remove redundant null check on entry

Alex Hung alex.hung at canonical.com
Wed Sep 22 19:07:59 UTC 2021


On 2021-09-22 4:12 a.m., Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> The pointer check on entry is redundant as this is already checked
> in the while loop condition above. Clean up code by removing it.
> 
> Cleans up cppcheck style warning.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpi/cstates/cstates.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/acpi/cstates/cstates.c b/src/acpi/cstates/cstates.c
> index 45073c15..1fd65f9e 100644
> --- a/src/acpi/cstates/cstates.c
> +++ b/src/acpi/cstates/cstates.c
> @@ -66,7 +66,7 @@ static void get_cstates(char *path, fwts_cstates *state)
>  		return;
>  
>  	while ((entry = readdir(dir)) != NULL) {
> -		if (entry && strlen(entry->d_name)>3) {
> +		if (strlen(entry->d_name) > 3) {
>  			long int nr;
>  			int count;
>  
> 


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



More information about the fwts-devel mailing list