mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] string: inline isempty
@ 2024-05-28  8:25 Ahmad Fatoum
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-05-28  8:25 UTC (permalink / raw)
  To: barebox; +Cc: ore, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-28  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-28  8:25 [PATCH 1/2] string: inline isempty Ahmad Fatoum
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox