From patchwork Mon Jun 24 17:48:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 253939 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 C519E2C008F for ; Tue, 25 Jun 2013 03:50:38 +1000 (EST) Received: from localhost ([::1]:57007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAuS-00044P-Vd for incoming@patchwork.ozlabs.org; Mon, 24 Jun 2013 13:50:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAsv-0001Ub-2N for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrAst-0008Fp-DA for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:49:00 -0400 Received: from [2a03:4000:2:362::1] (port=57433 helo=v2201305906712890.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrAst-0008Eg-6l for qemu-devel@nongnu.org; Mon, 24 Jun 2013 13:48:59 -0400 Received: by v2201305906712890.yourvserver.net (Postfix, from userid 1000) id 72593182BBC; Mon, 24 Jun 2013 19:48:56 +0200 (CEST) From: Stefan Weil To: David Gibson , Alexander Graf Date: Mon, 24 Jun 2013 19:48:48 +0200 Message-Id: <1372096130-24994-3-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: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a03:4000:2:362::1 Cc: Stefan Weil , qemu-devel Subject: [Qemu-devel] [PATCH 2/3] spapr: Fix compiler warning for some versions of gcc (h_remove) 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_hcall.c:188:1: warning: control reaches end of non-void function [-Wreturn-type] Replacing the 4th case REMOVE_HW (which is currently unused) by the default case fixes this warning. The assertion is dead code because all possible cases are handled in the switch statements, so remove it. This avoids future warnings from static code analyzers. Signed-off-by: Stefan Weil --- hw/ppc/spapr_hcall.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 00f21f5..d49ce53 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -180,11 +180,9 @@ static target_ulong h_remove(PowerPCCPU *cpu, sPAPREnvironment *spapr, case REMOVE_PARM: return H_PARAMETER; - case REMOVE_HW: + default: /* REMOVE_HW */ return H_HARDWARE; } - - assert(0); } #define H_BULK_REMOVE_TYPE 0xc000000000000000ULL