From patchwork Wed Aug 24 13:00:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 111336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 84D28B6F64 for ; Wed, 24 Aug 2011 23:00:45 +1000 (EST) Received: from localhost ([::1]:58476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwD4U-0004h5-Lf for incoming@patchwork.ozlabs.org; Wed, 24 Aug 2011 09:00:42 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwD4N-0004gQ-DX for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:00:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwD4I-0006OB-En for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:00:35 -0400 Received: from thoth.sbs.de ([192.35.17.2]:24427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwD4I-0006Nh-20 for qemu-devel@nongnu.org; Wed, 24 Aug 2011 09:00:30 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id p7OD0QsS013622; Wed, 24 Aug 2011 15:00:26 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p7OD0PCD011734; Wed, 24 Aug 2011 15:00:25 +0200 Message-ID: <4E54F5E9.1020104@siemens.com> Date: Wed, 24 Aug 2011 15:00:25 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Avi Kivity References: <1314187627-20975-1-git-send-email-avi@redhat.com> <4E54F2A2.6000100@siemens.com> <4E54F57D.8070809@redhat.com> In-Reply-To: <4E54F57D.8070809@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.2 Cc: "qemu-devel@nongnu.org" Subject: Re: [Qemu-devel] [PATCH] vga: squash build error in vga_update_memory_access() 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 On 2011-08-24 14:58, Avi Kivity wrote: > On 08/24/2011 03:46 PM, Jan Kiszka wrote: >>> +++ b/hw/vga.c >>> @@ -179,6 +179,8 @@ static void vga_update_memory_access(VGACommonState *s) >>> base = 0xb8000; >>> size = 0x8000; >>> break; >>> + default: >>> + abort(); >>> } >>> region = g_malloc(sizeof(*region)); >>> memory_region_init_alias(region, "vga.chain4",&s->vram, offset, size); >> >> ...or just make the last case default? >> > > No reason to make the code unobvious in this path, IMO. Eventually gcc > will be able to drop the 4/5 bytes this patch adds to the object code. ...is fairly common and well readable IMHO. Jan diff --git a/hw/vga.c b/hw/vga.c index 851fd68..125fb29 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -176,6 +176,7 @@ static void vga_update_memory_access(VGACommonState *s) size = 0x8000; break; case 3: + default: base = 0xb8000; size = 0x8000; break;