Received: from eggs.gnu.org ([140.186.70.92]:40433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1YgH-0001mh-Eh for qemu-devel@nongnu.org; Thu, 08 Sep 2011 03:05:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1YgG-0003wm-Bj for qemu-devel@nongnu.org; Thu, 08 Sep 2011 03:05:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1YgG-0003we-4l for qemu-devel@nongnu.org; Thu, 08 Sep 2011 03:05:48 -0400 From: Markus Armbruster References: <1315328340-6192-1-git-send-email-armbru@redhat.com> <1315328340-6192-3-git-send-email-armbru@redhat.com> <4E67905A.8040702@redhat.com> Date: Thu, 08 Sep 2011 09:05:37 +0200 In-Reply-To: <4E67905A.8040702@redhat.com> (Kevin Wolf's message of "Wed, 07 Sep 2011 17:40:10 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Kevin Wolf 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 Kevin Wolf writes: > 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 <= ? I plead temporary insanity. Want a v4, or want to fix it up yourself?