lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 23 Oct 2021 20:04:51 +0200
From:   Jim Christian Haukvik <jchaukvik@...il.com>
To:     johan@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Jim Christian Haukvik <jchaukvik@...il.com>
Subject: [PATCH] kernel/params.c: Refactor dash2underscore

This patch refactors the dash2underscore function
to use the ternary operator.

Signed-off-by: Jim Christian Haukvik <jchaukvik@...il.com>
---
 kernel/params.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/params.c b/kernel/params.c
index 8299bd764e42..865a76fec79a 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -76,9 +76,7 @@ static void maybe_kfree_parameter(void *param)
 
 static char dash2underscore(char c)
 {
-	if (c == '-')
-		return '_';
-	return c;
+	return (c == '-') ? '_' : c;
 }
 
 bool parameqn(const char *a, const char *b, size_t n)
-- 
2.33.1

Powered by blists - more mailing lists