From patchwork Wed Feb 15 16:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 653721 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432066wrr; Wed, 15 Feb 2023 08:19:55 -0800 (PST) X-Google-Smtp-Source: AK7set/8zHvhJzWu8TeXpg1nyCJINv/erQCxOQyBBL+vAUQdoszZtUhtjVs4xpJZPOvoFKfKX0YT X-Received: by 2002:a05:6214:e67:b0:56e:b1d2:9c2a with SMTP id jz7-20020a0562140e6700b0056eb1d29c2amr4604960qvb.28.1676477995455; Wed, 15 Feb 2023 08:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676477995; cv=none; d=google.com; s=arc-20160816; b=GFJ1pk+riQacQ6fqsfSstA6J14sDcOlehEWF866ERxvkxQqG+Qe4IfrHClQ1P5kqp6 YmIgbrOAMwovSOHtPMtkR5l9uFuI6pIG5+m+WHNb7XrJHj+89vo97o98YBEa1Yq72Eo9 BLy1bKrBMOlEWOAJIORIelWwE0alkMpNU4j/slDK+hSb/4jOsYEbOUYO3iXlLcVCxWd9 Zu+Xp5UUKU3zPcEO/5UWDCai6Po5p7q+d8Ipx30XKEYAFmgJfjGYCUzhSNspnc09L+Jr k6jMsRZc/lGYiuTSw9PUByfbJpK4Ixo/wPbRXwfR7TRARS6OEJJkUcbnyMR72TRJ6nrK P5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=N1EIfkClSjaM3zvqOesphbcfRGV0aFPgoFdauJ2lJrchfsizltbcasHVqEnXkEEB0D ICn1gNJbHLgV4pFL2py8dqUF5orvTi5AeXl7Zpb3fm67X5Iwy5mJtfoVrS9k/RaP6tLZ CoQVExAXWrJgqRLb8HC5TkBAY394aN2w5gpwlj5zdVo7y074MLxdgXgZ/5wo+gi47UuA Ztdb3Dberfg5YDyb+oH3DRuNxzhfOdz2I6M3f/h0eC2NaegQq+gHb5CE/X6786h0OGZw zRHqRpiwv+MGmOh2Or5QXL9O5jd5rohUTlxn0is5VklQ4CXG27uvlaaiDHVAE10bGlSo 0cUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkvuG9tJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e21-20020a0cb455000000b0053b81ec39f4si13570881qvf.462.2023.02.15.08.19.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:19:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lkvuG9tJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSKTO-0007Mj-KO; Wed, 15 Feb 2023 11:17:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSKTI-0007Ie-Tv for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:33 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSKTH-0008Fs-7b for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:17:28 -0500 Received: by mail-wm1-x333.google.com with SMTP id az4-20020a05600c600400b003dff767a1f1so1936919wmb.2 for ; Wed, 15 Feb 2023 08:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=lkvuG9tJZarHsGLOIK0ZpVka/xEWqAXIQs3/LUaVxFFISGzwXxqcUa2owhDwsua0lS 3dUXMHdFk/yIew8jNZQDsuPTqkiPl6p9ATS2N4qOWLU+YmngA3jRokcUWe+PeEKoP+oa sdo+Eleisgvi4OVqoApnxNzqlQh4M145qyXENYanQ9+Atk6ahDI/N5j42f8B5RABa2eJ l1Y6EM/caxnVrJ6CMSWI3TND4lrJHA7n+8yyjHXCW/V0QlBYpNCaw41ZQxctmVnhNbgk icdyZTfpMldW+kkUCti9g/H4wFDy3qCGEUgsW+UkR3jnEO6O1FmUd2IWHh2xeVQ6MGF8 sPsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eT7ksvlpde91QYYwVbkpPCgkO0ujQKCgKvgofZh4Aq4=; b=4zi3nYH6ngCu6cKpsV4SN1M5LtNsV7huenoIvFUbmbzHJa1Zv5dOY3qlLwsL4fMJfC 1IeyeM3I3i3oyHfd4ySpt5KWj3JcADRa87TTLDt827G6d36WEaQ/7fc1ns9dPYAqjCvF DrAXM1YOoH5pnYQT8y0hp0gMnY95HBlZaKq54w4GjlsyM1T6tqeWzF5jn52AwCwGDwes G8AkjX8/pXDl9ftAy9w6I7jlRvEID4oSCzhEh/HOMHqVCUnnhEPCGDJ/+pTup0PxmkLT 1CY4BqPSxS1K3m5Lf3/3/kPeUkwsfS1OoIVt+Z+whgR5dc++2CVHtpY0+Bv76GeSKdAN V8hg== X-Gm-Message-State: AO0yUKVHWO09Eqfg8fS/Wz7qCiESYmvMkRWU6bjU1LjbhGcTY5bj2UeU oH3cUcoxyVN32GQY1nb3iW9cJsNKpVmw7N1F X-Received: by 2002:a05:600c:4e54:b0:3df:9858:c03c with SMTP id e20-20020a05600c4e5400b003df9858c03cmr3550017wmq.17.1676477846330; Wed, 15 Feb 2023 08:17:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d16-20020a5d5390000000b002c4008f0daasm16061419wrv.107.2023.02.15.08.17.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann Subject: [PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq() Date: Wed, 15 Feb 2023 17:16:31 +0100 Message-Id: <20230215161641.32663-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Last commit removed the last use of isa_get_irq(NULL). Add an assertion to ensure we won't use that hack again. Deprecate in favor of the BUS API: isa_bus_get_irq(). Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/isa-bus.c | 6 +++--- include/hw/isa/isa.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 96bfee9aa7..a9b94e6c8a 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -85,10 +85,10 @@ qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum) * This function is only for special cases such as the 'ferr', and * temporary use for normal devices until they are converted to qdev. */ -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq) +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum) { - assert(!dev || ISA_BUS(qdev_get_parent_bus(DEVICE(dev))) == isabus); - return isa_bus_get_irq(isabus, isairq); + assert(dev); + return isa_bus_get_irq(ISA_BUS(qdev_get_parent_bus(DEVICE(dev))), irqnum); } void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 42d36b21a3..1084d68ead 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -74,7 +74,6 @@ struct ISADevice { ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space, MemoryRegion *address_space_io, Error **errp); void isa_bus_irqs(ISABus *bus, qemu_irq *irqs); -qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq); void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq); void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16); IsaDma *isa_bus_get_dma(ISABus *bus, int nchan); @@ -95,6 +94,9 @@ ISADevice *isa_create_simple(ISABus *bus, const char *name); ISADevice *isa_vga_init(ISABus *bus); +/* isa_get_irq() is deprecated, please use isa_bus_get_irq() instead. */ +qemu_irq isa_get_irq(ISADevice *dev, unsigned irqnum); + /** * isa_register_ioport: Install an I/O port region on the ISA bus. *