From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWG89-0002G4-PR for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:47:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWG87-0002FH-V7 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:47:37 -0400 Received: from [199.232.76.173] (port=58151 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWG87-0002F4-Lq for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:47:35 -0400 Received: from an-out-0708.google.com ([209.85.132.247]:8714) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KWG87-0001Bb-MP for qemu-devel@nongnu.org; Thu, 21 Aug 2008 15:47:35 -0400 Received: by an-out-0708.google.com with SMTP id d18so25057and.130 for ; Thu, 21 Aug 2008 12:47:34 -0700 (PDT) Message-ID: <48ADC629.90703@codemonkey.ws> Date: Thu, 21 Aug 2008 14:46:49 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Ignore IDE command if issued while IDE is busy. References: <20080818102240.30186.32779.stgit@gleb-debian.qumranet.com.qumranet.com> In-Reply-To: <20080818102240.30186.32779.stgit@gleb-debian.qumranet.com.qumranet.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gleb Natapov Gleb Natapov wrote: > @@ -2511,6 +2524,11 @@ static uint32_t ide_data_readw(void *opaque, uint32_t addr) > IDEState *s = ((IDEState *)opaque)->cur_drive; > uint8_t *p; > int ret; > + > + /* PIO data access allowed only when DRQ bit is set */ > + if (!(s->status & DRQ_STAT)) > + return; > Returns a uint32_t but you just do return; > p = s->data_ptr; > ret = cpu_to_le16(*(uint16_t *)p); > p += 2; > @@ -2525,6 +2543,10 @@ static void ide_data_writel(void *opaque, uint32_t addr, uint32_t val) > IDEState *s = ((IDEState *)opaque)->cur_drive; > uint8_t *p; > > + /* PIO data access allowed only when DRQ bit is set */ > + if (!(s->status & DRQ_STAT)) > + return; > + > p = s->data_ptr; > *(uint32_t *)p = le32_to_cpu(val); > p += 4; > @@ -2539,6 +2561,10 @@ static uint32_t ide_data_readl(void *opaque, uint32_t addr) > uint8_t *p; > int ret; > > + /* PIO data access allowed only when DRQ bit is set */ > + if (!(s->status & DRQ_STAT)) > + return; > This function returns a uint32_t but you just have a return; here. Regards, Anthony Liguori > p = s->data_ptr; > ret = cpu_to_le32(*(uint32_t *)p); > p += 4; > > > >