]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: netconsole: Remove unnecessary cast from bool
authorBreno Leitao <leitao@debian.org>
Tue, 9 Jul 2024 14:43:59 +0000 (07:43 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Jul 2024 01:32:48 +0000 (18:32 -0700)
The 'enabled' variable is already a bool, so casting it to its value
is redundant.

Remove the superfluous cast, improving code clarity without changing
functionality.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20240709144403.544099-2-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c

index ab8a0623b1a17dccdd240e799700cb7fc1a10d4f..de0d89e4e4e2a47fbce6e40b40b1a018d7d7a313 100644 (file)
@@ -344,7 +344,7 @@ static ssize_t enabled_store(struct config_item *item,
                goto out_unlock;
 
        err = -EINVAL;
-       if ((bool)enabled == nt->enabled) {
+       if (enabled == nt->enabled) {
                pr_info("network logging has already %s\n",
                        nt->enabled ? "started" : "stopped");
                goto out_unlock;