[PATCH] lib: fwts_ac_adapter: remove redundant pointer ac_entry

Colin King colin.king at canonical.com
Wed Apr 28 22:07:18 UTC 2021


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 */
-- 
2.30.2




More information about the fwts-devel mailing list