Skip to contentSkip to conversation

qemu-ga: drop unused local err variable

PATCH Applied Stefan Hajnoczi 3 participants 3 messages Mar 16, 2016 – Mar 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-ga: drop unused local err variable

Commit 125b310e1d62e3a1dc1e7758563e598957ca7ae4 ("qemu-ga: move channel/transport functionality into wrapper class") stopped using the local err variable in channel_event_cb().

This patch deletes the unused variable.

---
 qga/main.c | 6 ------
 1 file changed, 6 deletions(-)
qga/main.c +0 -6
index 0a168e2..743c5c1 100644
@@ -618,13 +618,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data)
     GAState *s = data;
     gchar buf[QGA_READ_COUNT_DEFAULT+1];
     gsize count;
-    GError *err = NULL;
     GIOStatus status = ga_channel_read(s->channel, buf, QGA_READ_COUNT_DEFAULT, &count);
-    if (err != NULL) {
-        g_warning("error reading channel: %s", err->message);
-        g_error_free(err);
-        return false;
-    }
     switch (status) {
     case G_IO_STATUS_ERROR:
         g_warning("error reading channel");
Signature · 1 line
2.5.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Stefan Hajnoczi

Commit 125b310e1d62e3a1dc1e7758563e598957ca7ae4 ("qemu-ga: move channel/transport functionality into wrapper class") stopped using the local err variable in channel_event_cb().

This patch deletes the unused variable.

---
 qga/main.c | 6 ------
 1 file changed, 6 deletions(-)
qga/main.c +0 -6
index 0a168e2..743c5c1 100644
@@ -618,13 +618,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data)
     GAState *s = data;
     gchar buf[QGA_READ_COUNT_DEFAULT+1];
     gsize count;
-    GError *err = NULL;
     GIOStatus status = ga_channel_read(s->channel, buf, QGA_READ_COUNT_DEFAULT, &count);
-    if (err != NULL) {
-        g_warning("error reading channel: %s", err->message);
-        g_error_free(err);
-        return false;
-    }
     switch (status) {
     case G_IO_STATUS_ERROR:
         g_warning("error reading channel");
Signature · 1 line
2.5.0
Applied
#2 lore raw
In reply to Stefan Hajnoczi

Quoting Stefan Hajnoczi (2016-03-16 10:16:02)

Quoted 7 lines

Commit 125b310e1d62e3a1dc1e7758563e598957ca7ae4 ("qemu-ga: move channel/transport functionality into wrapper class") stopped using the local err variable in channel_event_cb().

This patch deletes the unused variable.

Thanks, applied to qga tree:

https://github.com/mdroth/qemu/commits/qga

Quoted 25 lines
---
 qga/main.c | 6 ------
 1 file changed, 6 deletions(-)
qga/main.c +0 -6
index 0a168e2..743c5c1 100644
@@ -618,13 +618,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data)
     GAState *s = data;
     gchar buf[QGA_READ_COUNT_DEFAULT+1];
     gsize count;
-    GError *err = NULL;
     GIOStatus status = ga_channel_read(s->channel, buf, QGA_READ_COUNT_DEFAULT, &count);
-    if (err != NULL) {
-        g_warning("error reading channel: %s", err->message);
-        g_error_free(err);
-        return false;
-    }
     switch (status) {
     case G_IO_STATUS_ERROR:
         g_warning("error reading channel");
Signature · 1 line
2.5.0