From patchwork Fri Oct 10 19:33:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 38633 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E1AA1202DB for ; Fri, 10 Oct 2014 19:33:06 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b15sf2572458eek.4 for ; Fri, 10 Oct 2014 12:33:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=yTMcgDEm0kknwHZ2wRoPB+81AxwIixxPjs8GKTUWrTY=; b=IsDlc4F8NVxfFufxEsalr8nZ3eIkgQ/Ip1WmIz7g5FYkZGTmRmB9aer2BBiKF0PpaZ RqJwfwKC3U7RQBvNFVvf8pREYm01uoGojQMOKRLBLQ2ve8GGxCC96wtuTdyHPqOrYZl+ nL3W6U9IHbEDMsD/aX53tW4MZHTKj8JidV/vA0Lssb/mKVWBBrGdIwcnnGSVXmcLeOZ5 ZUaiAZ9GHIfkk6n35gUwUU5NGwupXaeQ/Ak6eBehAxsIHbTkMAha8eiAgeM95nImSj/6 ScltRyN/Gdr1PHeAML5jdaTtvJ646qKoKz8Wvfa/nQuEN2D5TlHX8toOrWNQForLUcZI /LTw== X-Gm-Message-State: ALoCoQnzbgUrUrJPrGLQKBs2Nd1C+w3Zl55R/7s4XValPqDk+VP1Ebt4tBsTbZgYRF9EuD9zuv/Q X-Received: by 10.112.190.40 with SMTP id gn8mr1086226lbc.10.1412969585988; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.226 with SMTP id v2ls333384lav.50.gmail; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) X-Received: by 10.152.202.135 with SMTP id ki7mr7231158lac.16.1412969585759; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id u2si10772895lal.70.2014.10.10.12.33.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 12:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id w7so3724419lbi.36 for ; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr7233466lad.40.1412969585626; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp487106lbz; Fri, 10 Oct 2014 12:33:05 -0700 (PDT) X-Received: by 10.180.81.35 with SMTP id w3mr12816222wix.1.1412969584898; Fri, 10 Oct 2014 12:33:04 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ei1si4571010wib.71.2014.10.10.12.33.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 12:33:04 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Xcfvz-0005Tu-Iw; Fri, 10 Oct 2014 20:33:03 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Kevin Wolf , Stefan Hajnoczi , Luiz Capitulino , Eric Blake Subject: [PATCH] block.c: Fix type of IoOperationType variable in send_qmp_error_event() Date: Fri, 10 Oct 2014 20:33:03 +0100 Message-Id: <1412969583-21045-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The local variable 'ac' in send_qmp_error_event() is declared with the wrong type, which causes clang to complain when it is initialized and again when it is used: block.c:3655:20: warning: implicit conversion from enumeration type 'enum IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') [-Wenum-conversion] ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; ~ ^~~~~~~~~~~~~~~~~~~~~~ block.c:3655:45: warning: implicit conversion from enumeration type 'enum IoOperationType' to different enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') [-Wenum-conversion] ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; ~ ^~~~~~~~~~~~~~~~~~~~~~~ block.c:3656:62: warning: implicit conversion from enumeration type 'BlockErrorAction' (aka 'enum BlockErrorAction') to different enumeration type 'IoOperationType' (aka 'enum IoOperationType') [-Wenum-conversion] qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ Correct the type to IoOperationType, and rename the variable to 'optype' to match its correct type. Signed-off-by: Peter Maydell Reviewed-by: Eric Blake Reviewed-by: Luiz Capitulino --- Bug introduced when this code was pulled out into its own function in commit c7c2ff0c7e5d2c04. block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index d3aebeb..b61baca 100644 --- a/block.c +++ b/block.c @@ -3650,10 +3650,10 @@ static void send_qmp_error_event(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { - BlockErrorAction ac; + IoOperationType optype; - ac = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; - qapi_event_send_block_io_error(bdrv_get_device_name(bs), ac, action, + optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE; + qapi_event_send_block_io_error(bdrv_get_device_name(bs), optype, action, bdrv_iostatus_is_enabled(bs), error == ENOSPC, strerror(error), &error_abort);