From 3931056767acb5c44721a9f0870135646b39b70e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 14 May 2020 09:37:27 +0200 Subject: [PATCH] proc-cmdline: add some explanatory comments --- src/basic/proc-cmdline.c | 6 +++--- src/basic/proc-cmdline.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c index d3d99d9a7f..d8d30b0f1d 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -268,17 +268,17 @@ int proc_cmdline_get_bool(const char *key, bool *ret) { r = proc_cmdline_get_key(key, PROC_CMDLINE_VALUE_OPTIONAL, &v); if (r < 0) return r; - if (r == 0) { + if (r == 0) { /* key not specified at all */ *ret = false; return 0; } - if (v) { /* parameter passed */ + if (v) { /* key with parameter passed */ r = parse_boolean(v); if (r < 0) return r; *ret = r; - } else /* no parameter passed */ + } else /* key without parameter passed */ *ret = true; return 1; diff --git a/src/basic/proc-cmdline.h b/src/basic/proc-cmdline.h index 4115fdbc99..275f46c89e 100644 --- a/src/basic/proc-cmdline.h +++ b/src/basic/proc-cmdline.h @@ -6,9 +6,9 @@ #include "log.h" typedef enum ProcCmdlineFlags { - PROC_CMDLINE_STRIP_RD_PREFIX = 1 << 0, - PROC_CMDLINE_VALUE_OPTIONAL = 1 << 1, - PROC_CMDLINE_RD_STRICT = 1 << 2, + PROC_CMDLINE_STRIP_RD_PREFIX = 1 << 0, /* automatically strip "rd." prefix if it is set (and we are in the initrd, since otherwise we'd not consider it anyway) */ + PROC_CMDLINE_VALUE_OPTIONAL = 1 << 1, /* the value is optional (for boolean switches that can omit the value) */ + PROC_CMDLINE_RD_STRICT = 1 << 2, /* ignore this in the initrd */ } ProcCmdlineFlags; typedef int (*proc_cmdline_parse_t)(const char *key, const char *value, void *data);