diff mbox

[12/20] monitor: Inline monitor_has_error() into its only caller

Message ID 1432294585-5984-13-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster May 22, 2015, 11:36 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Eric Blake May 22, 2015, 10:23 p.m. UTC | #1
On 05/22/2015 05:36 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  monitor.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/monitor.c b/monitor.c
> index c732203..71ca03f 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -377,11 +377,6 @@ static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream,
>      return 0;
>  }
>  
> -static inline int monitor_has_error(const Monitor *mon)
> -{
> -    return mon->error != NULL;

Yay - gets rid of a function returning 0 or 1 instead of a proper bool :)

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

Patch

diff --git a/monitor.c b/monitor.c
index c732203..71ca03f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -377,11 +377,6 @@  static int GCC_FMT_ATTR(2, 3) monitor_fprintf(FILE *stream,
     return 0;
 }
 
-static inline int monitor_has_error(const Monitor *mon)
-{
-    return mon->error != NULL;
-}
-
 static void monitor_json_emitter(Monitor *mon, const QObject *data)
 {
     QString *json;
@@ -5031,7 +5026,7 @@  static void handle_qmp_command(JSONMessageParser *parser, QList *tokens)
 
     if (cmd->mhandler.cmd_new(mon, args, &data)) {
         /* Command failed... */
-        if (!monitor_has_error(mon)) {
+        if (!mon->error) {
             /* ... without setting an error, so make one up */
             qerror_report(QERR_UNDEFINED_ERROR);
         }