From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLUlv-0006OT-HK for qemu-devel@nongnu.org; Tue, 19 Jan 2016 06:48:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLUls-0002Af-8I for qemu-devel@nongnu.org; Tue, 19 Jan 2016 06:48:27 -0500 Sender: Paolo Bonzini References: <1453179117-17909-1-git-send-email-jsnow@redhat.com> <1453179117-17909-2-git-send-email-jsnow@redhat.com> From: Paolo Bonzini Message-ID: <569E2283.9070904@redhat.com> Date: Tue, 19 Jan 2016 12:48:19 +0100 MIME-Version: 1.0 In-Reply-To: <1453179117-17909-2-git-send-email-jsnow@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: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com 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;