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

Colin King colin.king at canonical.com
Wed Sep 22 10:12:26 UTC 2021


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;
 
-- 
2.32.0




More information about the fwts-devel mailing list