From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTRv-0008Qo-1t for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiTRm-0008Uw-OG for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiTRm-0008Uj-HY for qemu-devel@nongnu.org; Thu, 08 May 2014 14:53:34 -0400 From: Luiz Capitulino Date: Thu, 8 May 2014 14:52:52 -0400 Message-Id: <1399575182-9768-29-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1399575182-9768-1-git-send-email-lcapitulino@redhat.com> References: <1399575182-9768-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 28/38] qapi: Drop redundant, unclean error_is_set() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws From: Markus Armbruster do_qmp_dispatch()'s test for qmp_dispatch_check_obj() failure examines both the return value and the error object. The latter part is unclean; it works only when do_qmp_dispatch()'s caller passes a non-null errp argument. That's the case, but it's not locally obvious. Unclean. Cleanup would be easy enough, but since the unclean code is also redundant, let's just drop it. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Michael Roth Signed-off-by: Luiz Capitulino --- qapi/qmp-dispatch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c index 141a376..187af56 100644 --- a/qapi/qmp-dispatch.c +++ b/qapi/qmp-dispatch.c @@ -67,9 +67,8 @@ static QObject *do_qmp_dispatch(QObject *request, Error **errp) QmpCommand *cmd; QObject *ret = NULL; - dict = qmp_dispatch_check_obj(request, errp); - if (!dict || error_is_set(errp)) { + if (!dict) { return NULL; } -- 1.9.0