From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLZhp-00070v-0h for qemu-devel@nongnu.org; Tue, 19 Jan 2016 12:04:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLZho-0000uR-6G for qemu-devel@nongnu.org; Tue, 19 Jan 2016 12:04:32 -0500 References: <1453179117-17909-1-git-send-email-jsnow@redhat.com> <1453179117-17909-2-git-send-email-jsnow@redhat.com> <569E2283.9070904@redhat.com> From: John Snow Message-ID: <569E6C99.6020308@redhat.com> Date: Tue, 19 Jan 2016 12:04:25 -0500 MIME-Version: 1.0 In-Reply-To: <569E2283.9070904@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] ide: Prohibit RESET on IDE drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On 01/19/2016 06:48 AM, Paolo Bonzini wrote: > > > On 19/01/2016 05:51, John Snow wrote: >> + /* Only RESET is allowed to an ATAPI device while BSY and/or DRQ are set. */ >> + if (s->status & (BUSY_STAT|DRQ_STAT)) { >> + if (!(val == WIN_DEVICE_RESET) && (s->drive_kind == IDE_CD)) { > > I was going to complain about Pascal-ish parentheses, but actually I > think there is a bug here; the expression just looks weird. > > Did you mean > > if (!(val == WIN_DEVICE_RESET && s->drive_kind == IDE_CD)) > > or equivalently applying de Morgan's law: > > if (s->drive_kind != IDE_CD || val != WIN_DEVICE_RESET) > > ? > > Paolo > >> + return; > ugh, yes, I typo'd. Thank you. If you're still up, which do you find more readable? The (!(A && B)) form or the (!A || !B) form?