From 263a79642bfc2d37debefc8a8e96eb6e9efe7fc3 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 23 Sep 2020 15:25:41 -0400 Subject: [PATCH] cryptsetup-generator: avoid magic value in ternary `startswith` already returns the string with the prefix skipped, so we can simplify this further and avoid using a magic value. Noticed in passing. Co-authored-by: Lennart Poettering --- src/cryptsetup/cryptsetup-generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index 9a1ddf2094f..3ff50f4b6bc 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -541,7 +541,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat if (proc_cmdline_value_missing(key, value)) return 0; - d = get_crypto_device(startswith(value, "luks-") ? value+5 : value); + d = get_crypto_device(startswith(value, "luks-") ?: value); if (!d) return log_oom(); -- 2.47.3