From nobody Wed Oct 22 15:42:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519399733211244.66210362319646; Fri, 23 Feb 2018 07:28:53 -0800 (PST) Received: from localhost ([::1]:45178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFHI-00066c-DQ for importer@patchew.org; Fri, 23 Feb 2018 10:28:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFFK-0004a1-Ex for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:26:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epFFJ-0005VC-JW for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:26:50 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54274 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epFFH-0005Si-D5; Fri, 23 Feb 2018 10:26:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC045EB6ED; Fri, 23 Feb 2018 15:26:46 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-249.ams2.redhat.com [10.36.117.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id E04B720A8471; Fri, 23 Feb 2018 15:26:45 +0000 (UTC) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 23 Feb 2018 16:26:38 +0100 Message-Id: <20180223152640.11459-4-pbonzini@redhat.com> In-Reply-To: <20180223152640.11459-1-pbonzini@redhat.com> References: <20180223152640.11459-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Feb 2018 15:26:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 23 Feb 2018 15:26:46 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 3/5] ide: do not set s->end_transfer_func to ide_transfer_cancel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Lieven , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There is code checking s->end_transfer_func and it was not taught about ide_transfer_cancel. We can just use ide_transfer_stop because s->end_transfer_func is only ever called in the DRQ phase: after ide_transfer_cancel, the value of s->end_transfer_func is only used as a marker and never used to actually invoke the function. Signed-off-by: Paolo Bonzini --- hw/ide/core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c4710a6f55..447d9624df 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -553,10 +553,9 @@ static void ide_cmd_done(IDEState *s) } } =20 -static void ide_transfer_halt(IDEState *s, - void(*end_transfer_func)(IDEState *)) +static void ide_transfer_halt(IDEState *s) { - s->end_transfer_func =3D end_transfer_func; + s->end_transfer_func =3D ide_transfer_stop; s->data_ptr =3D s->io_buffer; s->data_end =3D s->io_buffer; s->status &=3D ~DRQ_STAT; @@ -564,7 +563,7 @@ static void ide_transfer_halt(IDEState *s, =20 void ide_transfer_stop(IDEState *s) { - ide_transfer_halt(s, ide_transfer_stop); + ide_transfer_halt(s); if (s->bus->dma->ops->end_transfer) { s->bus->dma->ops->end_transfer(s->bus->dma); } @@ -573,7 +572,7 @@ void ide_transfer_stop(IDEState *s) =20 static void ide_transfer_cancel(IDEState *s) { - ide_transfer_halt(s, ide_transfer_cancel); + ide_transfer_halt(s); } =20 int64_t ide_get_sector(IDEState *s) --=20 2.14.3