Patchwork [for-1.4,05/12] qmp: Drop superfluous special case "empty" in qmp_memchar_read()

login
register
mail settings
Submitter Markus Armbruster
Date Feb. 5, 2013, 4:22 p.m.
Message ID <1360081335-6594-6-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/218297/
State New
Headers show

Comments

Markus Armbruster - Feb. 5, 2013, 4:22 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qemu-char.c | 4 ----
 1 file changed, 4 deletions(-)
Eric Blake - Feb. 5, 2013, 8:52 p.m.
On 02/05/2013 09:22 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  qemu-char.c | 4 ----
>  1 file changed, 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/qemu-char.c b/qemu-char.c
> index 9bf53e0..036ca2c 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -2818,10 +2818,6 @@ char *qmp_memchar_read(const char *device, int64_t size,
>      }
>  
>      count = qemu_chr_cirmem_count(chr);
> -    if (count == 0) {
> -        return g_strdup("");
> -    }
> -
>      size = size > count ? count : size;
>      read_data = g_malloc0(size + 1);
>  
>

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 9bf53e0..036ca2c 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2818,10 +2818,6 @@  char *qmp_memchar_read(const char *device, int64_t size,
     }
 
     count = qemu_chr_cirmem_count(chr);
-    if (count == 0) {
-        return g_strdup("");
-    }
-
     size = size > count ? count : size;
     read_data = g_malloc0(size + 1);