mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: ore@pengutronix.de, Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] string: inline isempty
Date: Tue, 28 May 2024 10:25:41 +0200	[thread overview]
Message-ID: <20240528082542.3013919-1-a.fatoum@pengutronix.de> (raw)

The helper is trivial, so make it inline to save users the minimal
hassle of calling it out-of-line.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/string.h | 5 ++++-
 lib/string.c     | 6 ------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/include/string.h b/include/string.h
index 4ee3be6d93cc..5139c7ef1f3d 100644
--- a/include/string.h
+++ b/include/string.h
@@ -33,6 +33,9 @@ static inline bool streq_ptr(const char *a, const char *b)
 	return strcmp_ptr(a, b) == 0;
 }
 
-bool isempty(const char *s);
+static inline bool isempty(const char *s)
+{
+	return !s || s[0] == '\0';
+}
 
 #endif /* __STRING_H */
diff --git a/lib/string.c b/lib/string.c
index 7e4bec2e99cc..374f326143a7 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -1049,9 +1049,3 @@ char *strreplace(char *str, char old, char new)
 	return str;
 }
 EXPORT_SYMBOL(strreplace);
-
-bool isempty(const char *s)
-{
-	return !s || s[0] == '\0';
-}
-EXPORT_SYMBOL(isempty);
-- 
2.39.2




             reply	other threads:[~2024-05-28  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28  8:25 Ahmad Fatoum [this message]
2024-05-28  8:25 ` [PATCH 2/2] string: add nonempty helper Ahmad Fatoum
2024-05-28  9:00 ` [PATCH 1/2] string: inline isempty Sascha Hauer

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=20240528082542.3013919-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ore@pengutronix.de \
    /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