Skip to contentSkip to conversation

firmware_loader: Remove unnecessary conversion to bool

PATCH In review Jiapeng Chong 2 participants 2 messages Feb 18, 2021 – Apr 2, 2021 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware_loader: Remove unnecessary conversion to bool

Fix the following coccicheck warnings:

./tools/testing/selftests/firmware/fw_namespace.c:98:54-59: WARNING:
conversion to bool not needed here.

---
 tools/testing/selftests/firmware/fw_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/firmware/fw_namespace.c +1 -1
index 5ebc1ae..0e393cb 100644
@@ -95,7 +95,7 @@ static bool test_fw_in_ns(const char *fw_name, const char *sys_path, bool block_
 		}
 		if (block_fw_in_parent_ns)
 			umount("/lib/firmware");
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;
+		return WEXITSTATUS(status) == EXIT_SUCCESS;
 	}
 
 	if (unshare(CLONE_NEWNS) != 0) {
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 16 lines · Jiapeng Chong

Fix the following coccicheck warnings:

./tools/testing/selftests/firmware/fw_namespace.c:98:54-59: WARNING:
conversion to bool not needed here.

---
  tools/testing/selftests/firmware/fw_namespace.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/firmware/fw_namespace.c +0 -0
index 5ebc1ae..0e393cb 100644

tools/testing/selftests/firmware/fw_namespace.c static bool test_fw_in_ns(const char *fw_name, const char *sys_path, bool block_ · line 98

Quoted 4 lines
tools/testing/selftests/firmware/fw_namespace.c +0 -1
@@ -95,7 +95,7 @@ static bool test_fw_in_ns(const char *fw_name, const char *sys_path, bool block_
  		}
  		if (block_fw_in_parent_ns)
  			umount("/lib/firmware");
-		return WEXITSTATUS(status) == EXIT_SUCCESS ? true : false;

This looks right to me. test_fw_in_ns() returns true or false and test_fw_in_ns() callers print appropriate message.

I don't think this patch is necessary.

thanks,
-- Shuah