aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorBreno Leitao <[email protected]>2025-02-28 12:50:18 +0000
committerPaolo Abeni <[email protected]>2025-03-04 14:28:27 +0000
commitefb878fbe8d1fae3bf1974628e6d267dc861207e (patch)
treead953df41a0d357fbeca98d3506629959a42ecb6 /drivers/net/netconsole.c
parentnetconsole: prefix CPU_NR sysdata feature with SYSDATA_ (diff)
downloadkernel-efb878fbe8d1fae3bf1974628e6d267dc861207e.tar.gz
kernel-efb878fbe8d1fae3bf1974628e6d267dc861207e.zip
netconsole: Make boolean comparison consistent
Convert the current state assignment to use explicit boolean conversion, making the code more robust and easier to read. This change adds a double-negation operator to ensure consistent boolean conversion as suggested by Paolo[1]. This approach aligns with the existing pattern used in sysdata_cpu_nr_enabled_show(). Link: https://lore.kernel.org/all/[email protected]/ [1] Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index c086e2fe51f8..698dbbea2713 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -850,7 +850,7 @@ static ssize_t sysdata_cpu_nr_enabled_store(struct config_item *item,
return ret;
mutex_lock(&dynamic_netconsole_mutex);
- curr = nt->sysdata_fields & SYSDATA_CPU_NR;
+ curr = !!(nt->sysdata_fields & SYSDATA_CPU_NR);
if (cpu_nr_enabled == curr)
/* no change requested */
goto unlock_ok;