aboutsummaryrefslogtreecommitdiff
path: root/include/chardev
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-12-11 14:59:59 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-01-12 13:23:48 +0000
commit67b5595d3b333fc5bcf82ce1e3aedc217b68b99a (patch)
tree6f80f9b82e4776dea6129fa37d720abbe270b5f2 /include/chardev
parent2d41bf0fe1f70021a22033901777cd4ab42ca68f (diff)
chardev: use bool for fe_is_open
The function qemu_chr_fe_init already treats be->fe_open as a bool and if it acts like a bool it should be one. While we are at it make the variable name more descriptive and add kdoc decorations. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231211145959.93759-1-alex.bennee@linaro.org>
Diffstat (limited to 'include/chardev')
-rw-r--r--include/chardev/char-fe.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/chardev/char-fe.h b/include/chardev/char-fe.h
index 0ff6f87511..ecef182835 100644
--- a/include/chardev/char-fe.h
+++ b/include/chardev/char-fe.h
@@ -7,8 +7,12 @@
typedef void IOEventHandler(void *opaque, QEMUChrEvent event);
typedef int BackendChangeHandler(void *opaque);
-/* This is the backend as seen by frontend, the actual backend is
- * Chardev */
+/**
+ * struct CharBackend - back end as seen by front end
+ * @fe_is_open: the front end is ready for IO
+ *
+ * The actual backend is Chardev
+ */
struct CharBackend {
Chardev *chr;
IOEventHandler *chr_event;
@@ -17,7 +21,7 @@ struct CharBackend {
BackendChangeHandler *chr_be_change;
void *opaque;
int tag;
- int fe_open;
+ bool fe_is_open;
};
/**
@@ -156,12 +160,13 @@ void qemu_chr_fe_set_echo(CharBackend *be, bool echo);
/**
* qemu_chr_fe_set_open:
+ * @be: a CharBackend
+ * @is_open: the front end open status
*
- * Set character frontend open status. This is an indication that the
- * front end is ready (or not) to begin doing I/O.
- * Without associated Chardev, do nothing.
+ * This is an indication that the front end is ready (or not) to begin
+ * doing I/O. Without associated Chardev, do nothing.
*/
-void qemu_chr_fe_set_open(CharBackend *be, int fe_open);
+void qemu_chr_fe_set_open(CharBackend *be, bool is_open);
/**
* qemu_chr_fe_printf: