From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEIoX-0002B4-Tt for qemu-devel@nongnu.org; Mon, 25 Apr 2011 06:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEIoW-0005Xg-VI for qemu-devel@nongnu.org; Mon, 25 Apr 2011 06:14:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEIoW-0005XW-K1 for qemu-devel@nongnu.org; Mon, 25 Apr 2011 06:14:44 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3PAEgh9032024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Apr 2011 06:14:43 -0400 Date: Mon, 25 Apr 2011 15:44:37 +0530 From: Amit Shah Message-ID: <20110425101437.GC8308@amit-x200.redhat.com> References: <1303299015-11036-1-git-send-email-kwolf@redhat.com> <1303299015-11036-4-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1303299015-11036-4-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 3/5] ide/atapi: Use table instead of switch for commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On (Wed) 20 Apr 2011 [13:30:13], Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > hw/ide/atapi.c | 115 +++++++++++++++++++++++-------------------------------- > 1 files changed, 48 insertions(+), 67 deletions(-) > > diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c > index d161bf7..d0bf7fd 100644 > --- a/hw/ide/atapi.c > +++ b/hw/ide/atapi.c > @@ -533,10 +533,11 @@ static unsigned int event_status_media(IDEState *s, > return 8; /* We wrote to 4 extra bytes from the header */ > } > > -static void handle_get_event_status_notification(IDEState *s, > - uint8_t *buf, > - const uint8_t *packet) > +static void cmd_get_event_status_notification(IDEState *s, > + uint8_t *buf) > { > + const uint8_t *packet = buf; > + Exploiting packet == buf. But do we want to go away from that? Amit