diff mbox series

firmware_loader: Remove unnecessary conversion to bool

Message ID 1613639529-41139-1-git-send-email-jiapeng.chong@linux.alibaba.com
State Accepted
Commit 2c137388d685e11cf621b56bf06c4f3a1a8ff7be
Headers show
Series firmware_loader: Remove unnecessary conversion to bool | expand

Commit Message

Jiapeng Chong Feb. 18, 2021, 9:12 a.m. UTC
Fix the following coccicheck warnings:

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

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 tools/testing/selftests/firmware/fw_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shuah Khan April 2, 2021, 10:24 p.m. UTC | #1
On 2/18/21 2:12 AM, Jiapeng Chong wrote:
> Fix the following coccicheck warnings:

> 

> ./tools/testing/selftests/firmware/fw_namespace.c:98:54-59: WARNING:

> conversion to bool not needed here.

> 

> Reported-by: Abaci Robot <abaci@linux.alibaba.com>

> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

> ---

>   tools/testing/selftests/firmware/fw_namespace.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/tools/testing/selftests/firmware/fw_namespace.c b/tools/testing/selftests/firmware/fw_namespace.c

> index 5ebc1ae..0e393cb 100644

> --- a/tools/testing/selftests/firmware/fw_namespace.c

> +++ b/tools/testing/selftests/firmware/fw_namespace.c

> @@ -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
diff mbox series

Patch

diff --git a/tools/testing/selftests/firmware/fw_namespace.c b/tools/testing/selftests/firmware/fw_namespace.c
index 5ebc1ae..0e393cb 100644
--- a/tools/testing/selftests/firmware/fw_namespace.c
+++ b/tools/testing/selftests/firmware/fw_namespace.c
@@ -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) {