From patchwork Tue Jun 19 08:56:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Kardashevskiy X-Patchwork-Id: 10473795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74C986029B for ; Tue, 19 Jun 2018 08:58:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 667B928AF3 for ; Tue, 19 Jun 2018 08:58:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B3E828B26; Tue, 19 Jun 2018 08:58:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDA6828AF3 for ; Tue, 19 Jun 2018 08:58:08 +0000 (UTC) Received: from localhost ([::1]:40064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVCSl-0006BT-PH for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jun 2018 04:58:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVCRp-0005bC-0Q for qemu-devel@nongnu.org; Tue, 19 Jun 2018 04:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVCRl-0003tz-3M for qemu-devel@nongnu.org; Tue, 19 Jun 2018 04:57:09 -0400 Received: from [107.173.13.209] (port=44872 helo=ozlabs.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVCRk-0003ti-TG; Tue, 19 Jun 2018 04:57:04 -0400 Received: from vpl1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 02070AE80016; Tue, 19 Jun 2018 04:55:23 -0400 (EDT) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Date: Tue, 19 Jun 2018 18:56:31 +1000 Message-Id: <20180619085631.2859-1-aik@ozlabs.ru> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.173.13.209 Subject: [Qemu-devel] [PATCH qemu] xics-kvm: Fix compile warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This fixes uninitialized variable warning: /home/aik/p/qemu/hw/intc/xics_kvm.c: In function ‘ics_set_kvm_state’: /home/aik/p/qemu/hw/intc/xics_kvm.c:281:20: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] return ret; ^~~ Discovered with gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 from Ubuntu 18.04. Fixes: bf358b541b8 "xics_kvm: use KVM helpers" Signed-off-by: Alexey Kardashevskiy --- hw/intc/xics_kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 8bdf6af..48efbce 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -273,8 +273,8 @@ static int ics_set_kvm_state(ICSState *ics, int version_id) state |= KVM_XICS_QUEUED; } - kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES, - i + ics->offset, &state, true, &local_err); + ret = kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES, + i + ics->offset, &state, true, &local_err); if (local_err) { error_report("Unable to restore KVM interrupt controller state" " for IRQs %d: %s", i + ics->offset, strerror(errno));