diff mbox

error.c: don't return value for void function

Message ID 20120416073249.13295.65065.stgit@dhcp-8-167.nay.redhat.com
State New
Headers show

Commit Message

Amos Kong April 16, 2012, 7:32 a.m. UTC
It is invalid to return a value from a function
returning void.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 error.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Paolo Bonzini April 16, 2012, 8:58 a.m. UTC | #1
Il 16/04/2012 09:32, Amos Kong ha scritto:
> It is invalid to return a value from a function
> returning void.
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  error.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/error.c b/error.c
> index d3455ab..a52b771 100644
> --- a/error.c
> +++ b/error.c
> @@ -93,7 +93,7 @@ QDict *error_get_data(Error *err)
>  void error_set_field(Error *err, const char *field, const char *value)
>  {
>      QDict *dict = qdict_get_qdict(err->obj, "data");
> -    return qdict_put(dict, field, qstring_from_str(value));
> +    qdict_put(dict, field, qstring_from_str(value));
>  }
>  
>  void error_free(Error *err)

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Stefan Hajnoczi April 16, 2012, 9:43 a.m. UTC | #2
On Mon, Apr 16, 2012 at 03:32:49PM +0800, Amos Kong wrote:
> It is invalid to return a value from a function
> returning void.
> 
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  error.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan
diff mbox

Patch

diff --git a/error.c b/error.c
index d3455ab..a52b771 100644
--- a/error.c
+++ b/error.c
@@ -93,7 +93,7 @@  QDict *error_get_data(Error *err)
 void error_set_field(Error *err, const char *field, const char *value)
 {
     QDict *dict = qdict_get_qdict(err->obj, "data");
-    return qdict_put(dict, field, qstring_from_str(value));
+    qdict_put(dict, field, qstring_from_str(value));
 }
 
 void error_free(Error *err)