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

ivanhu ivan.hu at canonical.com
Thu Sep 23 03:41:47 UTC 2021



On 9/22/21 6:12 PM, 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: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list