From: Jim Christian Haukvik <jchaukvik@gmail.com>
To: johan@kernel.org
Cc: linux-kernel@vger.kernel.org,
Jim Christian Haukvik <jchaukvik@gmail.com>
Subject: [PATCH] kernel/params.c: Refactor dash2underscore
Date: Sat, 23 Oct 2021 20:04:51 +0200 [thread overview]
Message-ID: <20211023180451.59033-1-jchaukvik@gmail.com> (raw)
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
next reply other threads:[~2021-10-23 18:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-23 18:04 Jim Christian Haukvik [this message]
2021-10-24 10:39 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211023180451.59033-1-jchaukvik@gmail.com \
--to=jchaukvik@gmail.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®