From patchwork Mon Jun 24 17:48:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 253938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AD1092C008F for ; Tue, 25 Jun 2013 03:50:35 +1000 (EST) Received: from localhost ([::1]:56804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAuP-0003v5-Kg for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 13:50:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAsv-0001UY-17 for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrAst-0008G2-JL for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:00 -0400 Received: from qemu.weilnetz.de ([37.221.198.45]:45774 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAst-0008F3-CL for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:48:59 -0400 Received: by v2201305906712890.yourvserver.net (Postfix, from userid 1000) id DD4CE182BC0; Mon, 24 Jun 2013 19:48:56 +0200 (CEST) From: Stefan Weil To: David Gibson , Alexander Graf Date: Mon, 24 Jun 2013 19:48:49 +0200 Message-Id: <1372096130-24994-4-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372096130-24994-1-git-send-email-sw@weilnetz.de> References: <1372096130-24994-1-git-send-email-sw@weilnetz.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 37.221.198.45 Cc: Stefan Weil , qemu-devel Subject: [Qemu-devel] [PATCH 3/3] spapr: Fix compiler warning for some versions of gcc (spapr_io_read) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org i686-w64-mingw32-gcc (GCC) 4.6.3 from Debian wheezy reports this warning: hw/ppc/spapr_pci.c:454:1: warning: control reaches end of non-void function [-Wreturn-type] Adding a default case to the switch statement satisfies the compiler. This modification requires moving the assert statement. Signed-off-by: Stefan Weil --- hw/ppc/spapr_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 04e8362..c04086c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -448,9 +448,10 @@ static uint64_t spapr_io_read(void *opaque, hwaddr addr, case 2: return cpu_inw(addr); case 4: + default: + assert(size == 4); return cpu_inl(addr); } - assert(0); } static void spapr_io_write(void *opaque, hwaddr addr,