Patchwork [13/14] char: remove qemu_chr_send_event()

login
register
mail settings
Submitter Anthony Liguori
Date Aug. 15, 2011, 4:17 p.m.
Message ID <1313425061-12854-14-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/110068/
State New
Headers show

Comments

Anthony Liguori - Aug. 15, 2011, 4:17 p.m.
It's dead code.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 console.c   |   16 ----------------
 hw/baum.c   |   15 ---------------
 qemu-char.c |    6 ------
 qemu-char.h |    2 --
 4 files changed, 0 insertions(+), 39 deletions(-)

Patch

diff --git a/console.c b/console.c
index 489c74c..77285bf 100644
--- a/console.c
+++ b/console.c
@@ -1102,21 +1102,6 @@  static int console_puts(CharDriverState *chr, const uint8_t *buf, int len)
     return len;
 }
 
-static void console_send_event(CharDriverState *chr, int event)
-{
-    TextConsole *s = chr->opaque;
-    int i;
-
-    if (event == CHR_EVENT_FOCUS) {
-        for(i = 0; i < nb_consoles; i++) {
-            if (consoles[i] == s) {
-                console_select(i);
-                break;
-            }
-        }
-    }
-}
-
 static void kbd_send_chars(void *opaque)
 {
     TextConsole *s = opaque;
@@ -1462,7 +1447,6 @@  static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
     s = chr->opaque;
 
     chr->chr_write = console_puts;
-    chr->chr_send_event = console_send_event;
 
     s->out_fifo.buf = s->out_fifo_buf;
     s->out_fifo.buf_size = sizeof(s->out_fifo_buf);
diff --git a/hw/baum.c b/hw/baum.c
index 244eee5..80bc61a 100644
--- a/hw/baum.c
+++ b/hw/baum.c
@@ -468,20 +468,6 @@  static int baum_write(CharDriverState *chr, const uint8_t *buf, int len)
     return orig_len;
 }
 
-/* The other end sent us some event */
-static void baum_send_event(CharDriverState *chr, int event)
-{
-    BaumDriverState *baum = chr->opaque;
-    switch (event) {
-    case CHR_EVENT_BREAK:
-        break;
-    case CHR_EVENT_OPENED:
-        /* Reset state */
-        baum->in_buf_used = 0;
-        break;
-    }
-}
-
 /* Send the key code to the other end */
 static void baum_send_key(BaumDriverState *baum, uint8_t type, uint8_t value) {
     uint8_t packet[] = { type, value };
@@ -591,7 +577,6 @@  int chr_baum_init(QemuOpts *opts, CharDriverState **_chr)
 
     chr->opaque = baum;
     chr->chr_write = baum_write;
-    chr->chr_send_event = baum_send_event;
     chr->chr_accept_input = baum_accept_input;
     chr->chr_close = baum_close;
 
diff --git a/qemu-char.c b/qemu-char.c
index 9af6c58..3f41e3a 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -189,12 +189,6 @@  void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
     va_end(ap);
 }
 
-void qemu_chr_send_event(CharDriverState *s, int event)
-{
-    if (s->chr_send_event)
-        s->chr_send_event(s, event);
-}
-
 void qemu_chr_add_handlers(CharDriverState *s,
                            IOCanReadHandler *fd_can_read,
                            IOReadHandler *fd_read,
diff --git a/qemu-char.h b/qemu-char.h
index abd9cbd..fba0290 100644
--- a/qemu-char.h
+++ b/qemu-char.h
@@ -62,7 +62,6 @@  struct CharDriverState {
     IOCanReadHandler *chr_can_read;
     IOReadHandler *chr_read;
     void *handler_opaque;
-    void (*chr_send_event)(struct CharDriverState *chr, int event);
     void (*chr_close)(struct CharDriverState *chr);
     void (*chr_accept_input)(struct CharDriverState *chr);
     void (*chr_set_echo)(struct CharDriverState *chr, bool echo);
@@ -88,7 +87,6 @@  void qemu_chr_delete(CharDriverState *chr);
 void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
 int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len);
-void qemu_chr_send_event(CharDriverState *s, int event);
 void qemu_chr_add_handlers(CharDriverState *s,
                            IOCanReadHandler *fd_can_read,
                            IOReadHandler *fd_read,