From: Jonathan Lebon Date: Wed, 23 Sep 2020 19:25:41 +0000 (-0400) Subject: cryptsetup-generator: avoid magic value in ternary X-Git-Tag: v247-rc1~172^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17148%2Fhead;p=thirdparty%2Fsystemd.git 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 --- 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();