From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1KBo-0001SF-NJ for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1KBj-0002d6-4l for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:37:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1KBi-0002cv-U5 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 11:37:19 -0400 Message-ID: <4E67905A.8040702@redhat.com> Date: Wed, 07 Sep 2011 17:40:10 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1315328340-6192-1-git-send-email-armbru@redhat.com> <1315328340-6192-3-git-send-email-armbru@redhat.com> In-Reply-To: <1315328340-6192-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 02/27] ide: Use a table to declare which drive kinds accept each command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, pbonzini@redhat.com, hch@lst.de Am 06.09.2011 18:58, schrieb Markus Armbruster: > No functional change. > > It would be nice to have handler functions in the table, like commit > e1a064f9 did for ATAPI. Left for another day. > > Signed-off-by: Markus Armbruster > --- > hw/ide/core.c | 105 +++++++++++++++++++++++++++++++++++++++++++------------- > 1 files changed, 80 insertions(+), 25 deletions(-) > + [IBM_SENSE_CONDITION] = CFA_OK, > + [CFA_WEAR_LEVEL] = CFA_OK, > + [WIN_READ_NATIVE_MAX] = ALL_OK, > +}; > + > +static bool ide_cmd_permitted(IDEState *s, uint32_t cmd) > +{ > + return cmd <= ARRAY_SIZE(ide_cmd_table) Shouldn't it be < instead of <= ? Kevin