Messages in this thread Patch in this message | | | From | Jim Christian Haukvik <> | Subject | [PATCH] kernel/params.c: Refactor dash2underscore | Date | Sat, 23 Oct 2021 20:04:51 +0200 |
| |
This patch refactors the dash2underscore function to use the ternary operator.
Signed-off-by: Jim Christian Haukvik <jchaukvik@gmail.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
| |