aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorIon Agorria2024-01-05 09:22:08 +0200
committerMattijs Korpershoek2024-01-09 14:58:33 +0100
commit9ce75f49127858d1aa36d455a869137e4d36681b (patch)
treeb5b04e4a9835ae20f7b5c07d7e34516b141ffc38 /common
parent475aa9aabee7ab472341d755cc339f1345d5f49e (diff)
common: console: introduce console_record_isempty helper
Add console_record_isempty to check if console record buffer contains any data. Signed-off-by: Ion Agorria <ion@agorria.com> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240105072212.6615-4-clamor95@gmail.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Diffstat (limited to 'common')
-rw-r--r--common/console.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index 1ffda49c87e..6f2089caa00 100644
--- a/common/console.c
+++ b/common/console.c
@@ -853,6 +853,11 @@ int console_record_avail(void)
return membuff_avail((struct membuff *)&gd->console_out);
}
+bool console_record_isempty(void)
+{
+ return membuff_isempty((struct membuff *)&gd->console_out);
+}
+
int console_in_puts(const char *str)
{
return membuff_put((struct membuff *)&gd->console_in, str, strlen(str));