qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] ide: Prohibit RESET on IDE drives


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/5] ide: Prohibit RESET on IDE drives
Date: Tue, 19 Jan 2016 12:48:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0


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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]