From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>,
Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org
Subject: [PATCH v1 2/3] lib/string_helpers: Add str_high_low() helper
Date: Wed, 30 Nov 2022 13:50:21 +0200 [thread overview]
Message-ID: <20221130115022.68956-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20221130115022.68956-1-andriy.shevchenko@linux.intel.com>
Add str_high_low() helper to return 'high' or 'low' string literal.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/string_helpers.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h
index 8530c7328269..fd72393e7975 100644
--- a/include/linux/string_helpers.h
+++ b/include/linux/string_helpers.h
@@ -128,6 +128,11 @@ static inline const char *str_enabled_disabled(bool v)
return v ? "enabled" : "disabled";
}
+static inline const char *str_high_low(bool v)
+{
+ return v ? "high" : "low";
+}
+
static inline const char *str_read_write(bool v)
{
return v ? "read" : "write";
--
2.35.1
next prev parent reply other threads:[~2022-11-30 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 11:50 [PATCH v1 1/3] lib/string_helpers: Add missing header files to MAINTAINERS database Andy Shevchenko
2022-11-30 11:50 ` Andy Shevchenko [this message]
2022-11-30 11:50 ` [PATCH v1 3/3] lib/string_helpers: Split out string_choices.h Andy Shevchenko
2022-11-30 11:51 ` Andy Shevchenko
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=20221130115022.68956-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.