From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814938; cv=none; d=zohomail.com; s=zohoarc; b=WBndBjb3DBaZsvhzfMO1Pe6KsBLLINLvt4VFzxBelZ2W07osgkZT6WldNPuD0P+pfnFJa9YEnXcDnvQttEhjzZ7ANwE2lT9Lvy6ecy5HIJxdQcOvB0WCHFJPmYwDqs1AAu08pcekOclGZYZ8ZwAPEHHIqeHx3jNtbS2Vi6Fe5hQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814938; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=iXAu279+YpUX5VMQxHCx24FoUfO4mAFwXjl8aQ6UhXX2nm+F/ZZrn8SWSBXHTuqmtGM8uvisLd3fQjcq6VkQoF7yFmn301ammSwcBVDlDV67b3dcZvAnbu6CKVZDCXU643HgUKwQnDa3L82D/oL5xwHt4/frzpZDntETqbkEVf0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814938675142.65611558444778; Tue, 7 Feb 2023 16:08:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0C-0005RP-Pp; Tue, 07 Feb 2023 19:07:56 -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 1pPY0B-0005R1-RV for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:55 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY09-0008Rr-Ss for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:55 -0500 Received: by mail-wm1-x32e.google.com with SMTP id u10so9145174wmj.3 for ; Tue, 07 Feb 2023 16:07:53 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h2-20020a05600c350200b003dc434b39c7sm4063772wmq.0.2023.02.07.16.07.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:07:51 -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=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=uGbotc5R0AwV6G3Tuo91yBye5uHQHsD6ZQQcLJtHpCge8AvqPd2o9Z+dI2i1PGFVyy sLKGLzqnliN1YRuKsgWwRTxG70jWozsXA4RiCJrVQixhW376sGLKaw4o80rsKZ7fhzU4 6NGfwMXkXex0KWc/IDQ9e95kzzzoHM/WwVm8HgcH0hXMY+wNW9qodh6nSepT96ZfntdY rS/CN+fgZT0b0cBDKemEFbb6IUO1HwOQrmmYzZgxa55XwodBBoQ6nidtmgH/64wprFy1 hCMmI1j5WEXeBbu/5RysYUUFgay5A7WyNhHrPbL3i1U+PeIxjrkGa6w5xM7Q06+bRyYt UlYw== 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=23vodWxpK/bd5tZKFyrhR5Mgkn9GGF8RhXeyzoQkzds=; b=pNsV6yuxnWEJAgeK0rEEsQs51GsHV9A8xGbBBjjUeotZ9hsTYhCqM8DYlRwHLKIzzp u/oNwY3plCWg+eAyFeN7NpkI2we6y6czYU5WakCTAZaH8aW7jUmQ4n3MwKTez5Fx7AGB 2mbt8KPryf8fTxJNxlWGypFJX6FK4xy7uX07QZElG4314tRivtBlKY50Us3m/1kvyTt6 eXlM0tEc4VMtCexfk2oJYauxB3+pv+gxMliEyjnVPLNXo0pbAM+shQWBiW4YI8Uxn0zI d8JWkSn0LysNyLWKkBUu0TkWHtBaRnxbKuuRAIuADgVgPSOLrCsNsGghe4OLZIteG7KU cjmQ== X-Gm-Message-State: AO0yUKV3F0zBksu9Z9OlnuMubD17H+s+2FPHg1oLc7OsS2NoPsTt1LTk y1UbcV3jsK5dcw9HcjIWAHALJmuBU3AJrpc+ X-Google-Smtp-Source: AK7set8bsJHkPmkPKD30g9+D/bX1DSbK1lXdAyF0//i3ewxOWAgWnJJ9ZNzhKgZpr66mfXoKzDuKlg== X-Received: by 2002:a05:600c:3416:b0:3df:50eb:7ca6 with SMTP id y22-20020a05600c341600b003df50eb7ca6mr4840800wmp.15.1675814871595; Tue, 07 Feb 2023 16:07:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/7] hw/isa: Un-inline isa_bus_from_device() Date: Wed, 8 Feb 2023 01:07:37 +0100 Message-Id: <20230208000743.79415-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814940677100007 No point in inlining isa_bus_from_device() which is only used at device realization time. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 5 +++++ include/hw/isa/isa.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 4fe61d6dfe..5bd99379e9 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -162,6 +162,11 @@ bool isa_realize_and_unref(ISADevice *dev, ISABus *bus= , Error **errp) return qdev_realize_and_unref(&dev->parent_obj, &bus->parent_obj, errp= ); } =20 +ISABus *isa_bus_from_device(ISADevice *dev) +{ + return ISA_BUS(qdev_get_parent_bus(DEVICE(dev))); +} + ISADevice *isa_vga_init(ISABus *bus) { vga_interface_created =3D true; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 25acd5c34c..ad8bdd941f 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -123,9 +123,6 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *portio, void *opaque, const char *name); =20 -static inline ISABus *isa_bus_from_device(ISADevice *d) -{ - return ISA_BUS(qdev_get_parent_bus(DEVICE(d))); -} +ISABus *isa_bus_from_device(ISADevice *dev); =20 #endif --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814942; cv=none; d=zohomail.com; s=zohoarc; b=RQaqltuqr4OeEhQZfWDAE1QY4SkzkSBSxoJX9LBu7/TfytLbPq89LjYqqH89txmDyZkWRKdxzpv+29Z4mEt7kJXIzdVlZWr34r0gXzlFfFSbJTTaGzPG4rEvApscjOPO2y0ex8AH/jcVYmL3A1ZgWhe29mYYFGEd5XEEDyFT0Tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814942; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=D43HO3q2l9blhhSpsRbHqnKMH3L6yJ+3tcaB//wVQCWWN7xeFpHHXXd/KjVCq5gpCp2CWhoZNCPE0uNJ/YmJuLYq2LEq0cmAGJNUZax6l+Ol/KAUNwGPB0x585SAseBEgAzpsYWBF8kD0PnQyiTLj/DgUTL6Vgnctk50QL+C22A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814942351446.69066222837046; Tue, 7 Feb 2023 16:09:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0H-0005SK-Kc; Tue, 07 Feb 2023 19:08:01 -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 1pPY0F-0005Ry-US for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:00 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0E-0008Rr-55 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:07:59 -0500 Received: by mail-wm1-x32e.google.com with SMTP id u10so9145291wmj.3 for ; Tue, 07 Feb 2023 16:07:57 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h7-20020a05600c314700b003dc59d6f2f8sm283729wmo.17.2023.02.07.16.07.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:07:56 -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=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=KISIPCHMW8jjyuruF5tKYxLoSQIBoNoTotZpaR8UnCTk+RnckiU8Q9jP1idhMpPREI RR3cf0Ee2JdU+A8RxBXK26Nxda18Hq1AWpcGORkJBhIBr5v6797HDbzsOStBtojYoJjo jjp0gZTIRI1GI0DEXnQ5wOd6f8VlqXy0Q5Sbfcze88qmdN9Nr5cKaiJ7309wnjN6PWbZ +xnA/nAoNhg8UH60TnfCvhtBBoLizBovAnIMSY2Cum17vJI+UWIKv2vIc92br7D1KxZ6 zL+aHJiII/ZS7Ei5k62fwFj0uMiarAX4zql71FCQCxstbnKBxE7K9DXmBAGOCmaOM5Q1 dzLA== 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=uG/V5STTly/AiDD51pW5nIRJQwYRV7tuuua0OnmiC/A=; b=K/sw8UJ30uCFSYWoVqD/mBJBFXlU1jUZFt+4GGvkExWg2kUpBaNgLzlf7HsoEJerVm Lxt124HC6RUYkJulrLyrXSB6EFPaGL9Om59o4gOOHVWSd9IQ8m1BcmHniBGug965AD/5 JoOeL3b9Ew9Z82UIFl3eqvMsPb2ouqQA4T+blUhaXzCI25IsneC+9GKnF2n6CYRXQQw3 0kG1JSVltkHRzh5TYN4ji30XexCvpkxELt+UTzE9koeiIYQRz3ABjLPsir/hylBbPht4 T30hP8GL9J8qMClbIaSWqMQuPYWOFGr/cZvGA6/s2kJE9eQEqmBmXKsBKKLXzSQPnY7q nKPg== X-Gm-Message-State: AO0yUKWrEFAYaXUUEk9oqM5CSqG3lEeBthVXgh7PrCNoxzI5IbbQA1cp fcx+yeSwxb/9JtfATKWZlkZGpqSBLScdaldT X-Google-Smtp-Source: AK7set+AgZImcgFgdA33Me5d9EtLSt4UWVeGvPbeJWrRyQ9xWYVdOokqwaERzFNgovWTP2NMk4Ybnw== X-Received: by 2002:a05:600c:4d8a:b0:3de:d52:2cd2 with SMTP id v10-20020a05600c4d8a00b003de0d522cd2mr4633589wmp.4.1675814876873; Tue, 07 Feb 2023 16:07:56 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/7] hw/isa: Use isa_address_space_io() to reduce access on global 'isabus' Date: Wed, 8 Feb 2023 01:07:38 +0100 Message-Id: <20230208000743.79415-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814942880100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 5bd99379e9..95fc1ba5f7 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -114,7 +114,7 @@ static inline void isa_init_ioport(ISADevice *dev, uint= 16_t ioport) =20 void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start) { - memory_region_add_subregion(isabus->address_space_io, start, io); + memory_region_add_subregion(isa_address_space_io(dev), start, io); isa_init_ioport(dev, start); } =20 @@ -133,7 +133,7 @@ int isa_register_portio_list(ISADevice *dev, isa_init_ioport(dev, start); =20 portio_list_register(piolist, OBJECT(dev), pio_start, opaque, name, - isabus->address_space_io, start); + isa_address_space_io(dev), start); =20 return 0; } --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814952; cv=none; d=zohomail.com; s=zohoarc; b=IXjDjBSFE+6ur5R+R1N6uKtpArf6SQMRMDJclfDgVVnDxiD0oZ9eYLSuyVCCRWrhHBEN/6cCW8WCNejGUVW8fLmojSJywrbTr5Yq6W+yFu4hTF8+zLOK/xVVho4G+kOOYdwotk5cJtCfK2m23lQ1J/ym/CfgJGTgUSNzXH31GCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814952; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=nzXz13URqW9qRE+ujgdD6ZS6rNGoakYZABcqGHv+WptZyFgtrpT9vMuNNnsGsxvAWIVmt8wU8r2TbF5SxfX+p4BNpZliCadoKUW2xWlnBcSa0l466RCmRw7GkWUmMDFSyzRusOWVTXdHs1ybqZLpsyYCqAdIg63WuHfSxtl0DLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814952005649.3807975770112; Tue, 7 Feb 2023 16:09:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0s-0005gx-KY; Tue, 07 Feb 2023 19:08:38 -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 1pPY0L-0005TE-PW for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:36 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0K-0008T8-5e for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:05 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ba1so11124570wrb.5 for ; Tue, 07 Feb 2023 16:08:03 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id n10-20020a05600c304a00b003db1ca20170sm230525wmh.37.2023.02.07.16.08.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:01 -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=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=J89jpmx03GmYskJDiFaQletafQEWZIlvVTAlfawMaw2+n8iEI4EeRv+ymlv+DGhZya /py8QV2GO4sO1cVjfYIVsyBiABi3M94XL+zz9lp7CX8FIbZ2uUEPoP2RRbQZkLzf/wgL ZohZPKVT9R5pzTMm73KaptquFnH63UhvMhvV+WcT6dWiKtkW1lLyN2i673twA2SpvAMn tL5EglDzcDsamBYBZkb3eIJnC2mBJEI+kTCsl8Lf8sRXeea8X1H7AXtWeBCytaoh29qS IWnZlkYPb/0UpEh5OYDzK+VIh2lq4ueaaOy2EmqxqgTcJ7uvrST6mdcTc/LzCC+QAVtg sLZA== 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=4tTUjj/6z5YIik+WT6J4Jq4VcPmVbs4Ch1nMrvTlVBs=; b=itCGlBHMi1wrrfuFISf7L4rtbLMBbflEz15We1gVyrAGx+PDT2EM8SVzx0E4aES6Jq p5/lcvj1Fcc98fBob9tefjLrn2zVZXlz2NJj77evMXSOum7ZULOJupejAsPk4FXbYGdw aQsWBRV9XglMvlL9oOYUn4yELq7+Fn2b8x1qv9+D2AsDhTxWdSDBQsBgodpeBnuDAHB0 cT78n0OtEqdsOpHL8syM5HvVM11xB7ymfwEW9L+pMcvR3w1audTKWt1uSOgAlisK5Ggy QMxUfWNp/G6rV5mbnvguY3pHD+cXGqopnTD+3WWwfkmGQ+DirvxP/0pGpbl95PZ/aCC+ 6Wsw== X-Gm-Message-State: AO0yUKU8U9rqhKd8on5D8z923GVjUniQ4tCeAEFKxV/aRt1ze7WKKGiJ 05BClqA335HR+sri3TZpmlkcOHMnZyxMJ1Gk X-Google-Smtp-Source: AK7set/usesVN1YANfoutF1LkvKDrFw1CQfgDgqbMqApzOvmA23RkazO3RNlGdsPFWcBb0fiTTNVvw== X-Received: by 2002:a5d:6b88:0:b0:2c3:ea88:5e4d with SMTP id n8-20020a5d6b88000000b002c3ea885e4dmr4552313wrx.27.1675814882366; Tue, 07 Feb 2023 16:08:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/7] hw/ide: Rename ISA specific ide_init_ioport() as ide_init_ioport_isa() Date: Wed, 8 Feb 2023 01:07:39 +0100 Message-Id: <20230208000743.79415-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814952740100001 Rename ide_init_ioport() as ide_init_ioport_isa() to make explicit it expects an ISA device. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/ide/ioport.c | 2 +- hw/ide/isa.c | 2 +- hw/ide/piix.c | 4 ++-- include/hw/ide/internal.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index e6caa537fa..ac804a89e8 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -50,7 +50,7 @@ static const MemoryRegionPortio ide_portio2_list[] =3D { PORTIO_END_OF_LIST(), }; =20 -int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) +int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int iobase, int iobas= e2) { int ret; =20 diff --git a/hw/ide/isa.c b/hw/ide/isa.c index 8bedbd13f1..4dbd1e48b8 100644 --- a/hw/ide/isa.c +++ b/hw/ide/isa.c @@ -74,7 +74,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **e= rrp) ISAIDEState *s =3D ISA_IDE(dev); =20 ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2); - ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2); + ide_init_ioport_isa(&s->bus, isadev, s->iobase, s->iobase2); s->irq =3D isa_get_irq(isadev, s->isairq); ide_init2(&s->bus, s->irq); vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s); diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 267dbf37db..a587541bb2 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -140,8 +140,8 @@ static int pci_piix_init_ports(PCIIDEState *d) =20 for (i =3D 0; i < 2; i++) { ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret =3D ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase, - port_info[i].iobase2); + ret =3D ide_init_ioport_isa(&d->bus[i], NULL, + port_info[i].iobase, port_info[i].iobase= 2); if (ret) { return ret; } diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index fc0aa81a88..88a096f9df 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -628,7 +628,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDED= riveKind kind, int chs_trans, Error **errp); void ide_init2(IDEBus *bus, qemu_irq irq); void ide_exit(IDEState *s); -int ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2); +int ide_init_ioport_isa(IDEBus *bus, ISADevice *isa, int iobase, int iobas= e2); void ide_register_restart_cb(IDEBus *bus); =20 void ide_exec_cmd(IDEBus *bus, uint32_t val); --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814976; cv=none; d=zohomail.com; s=zohoarc; b=lvP8BMpPOpOfUU06jHauTrvJoE/WZAAbptjvJBUCcUYAOq0wuOaqqWXQOaAwC23TGrUdxY2cFcfWPoMwqOzzfUOsqp1M8hVK7E4PIvK+sZo1UPV4/P4AdXNplz0J2bpv5yP2i/84N8/VodOoWsW3IJDOFSPJUXTxC71OmY7UpBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814976; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=DXSMJinseGtYybmOjHOnouyWCu3JW2kEMnwCUgkRnKqop5w6zZBrrBwgVKHkHkN0KG8XFwyClngvf08utXfokxUEkWlunP37XXYD7Da1v3vXJcpC17hdauLcEKk5gGVOZLOSfn+RAr2FSkXEyxRnFuldlbvmE5xAOzkojut4thc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814976848673.3514529973561; Tue, 7 Feb 2023 16:09:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0w-0005mH-IZ; Tue, 07 Feb 2023 19:08:42 -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 1pPY0u-0005kM-H3 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008TU-B9 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: by mail-wr1-x42a.google.com with SMTP id a2so14914714wrd.6 for ; Tue, 07 Feb 2023 16:08:09 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5002000000b002c3be6ae0b1sm12252120wrt.65.2023.02.07.16.08.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:07 -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=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=Gi6ehZ2rFEWCzqXwYxBtZp0erXbt0/0kb/eBPAcrI/gBXJbqkoVAsXPeHSYQ9j/LPx 4LZyVxREXx+xeTSPFr8bgjGdDYPAhWsqoE2xVof+UMJYFDIFX5NxjwWiqMaMh24hWlme LuiXJsi6jki4z4qMBScOk30Hrpcz70xV/c+BS53p4rVkARU7AgmH9QZT3l8oKgekdO/p w0ePHbjyUSs+G1huhBNtW5/Xukjad5vOBgbfMzMyWg+Uo+9yQ2cGVQ1uMkRHY1yXVb1a 2qcIezxOKWwKYIsCY+R+PBqMREw5A+EExoHxZs2zTsUsLrH7xIIbmvBdNuqX3KzZYdS+ l23g== 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=diC00nVev9fo2jzQ51pUVYSS0FWICYuGAlQ1rUUG02E=; b=k9uvBhgI0uAvFDlXtw7rK1McHho/v54Gewr0C7/SNBxWIrXmbAdNHYucah10pHz1XQ kei0T2+HWP/ZCb93zsbotkVM3U2h6OOo8Hn/eImfJRC/ZMLA+VUxezDo5AHUiPdd3BZe 1S2CjHXk4zPr4MpBg9uv66HM73VHD3wCWufkY/Tp50DdiALlu2zeAE/naBkKz/P8qdwo jmKyZSQoS8ORDHm7rmW8jraQwbBQegQpree5RyKJZjLGtAsPoYXQAAVpIKjlih6TkXP/ fiqm3Lqb05Y5KR+xaC7IxqEN7XOuoXtaTgVdpdE9J5xnB1MgxHzGxewxMV902+QqeQkK 6//Q== X-Gm-Message-State: AO0yUKXxZ2/LkQpHvDyxpMT+LZzKMPKPkuOeJYv+v7c3Q1y8Q18Z0M4k 8h9mnXR9v11qM0CMf25WqS8U5Wb7PTnJ9a2X X-Google-Smtp-Source: AK7set/lKornttIik2H3Lgl3uHSa7F5rir9xEG+2MjXGpS9YaQAl+wJ1d1iPl/j3hkSpK2/2QKIduQ== X-Received: by 2002:a5d:60cb:0:b0:2c3:d65e:d131 with SMTP id x11-20020a5d60cb000000b002c3d65ed131mr4163809wrt.63.1675814887832; Tue, 07 Feb 2023 16:08:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/7] hw/ide: Introduce generic ide_init_ioport() Date: Wed, 8 Feb 2023 01:07:40 +0100 Message-Id: <20230208000743.79415-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814978805100007 Add ide_init_ioport() which is not restricted to the ISA bus. (Next commit will use it for a PCI device). Inspired-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/ioport.c | 11 +++++++++-- include/hw/ide/internal.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c index ac804a89e8..494fa88368 100644 --- a/hw/ide/ioport.c +++ b/hw/ide/ioport.c @@ -54,8 +54,6 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int = iobase, int iobase2) { int ret; =20 - /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA - bridge has been setup properly to always register with ISA. */ ret =3D isa_register_portio_list(dev, &bus->portio_list, iobase, ide_portio_list, bus, "ide"); =20 @@ -66,3 +64,12 @@ int ide_init_ioport_isa(IDEBus *bus, ISADevice *dev, int= iobase, int iobase2) =20 return ret; } + +void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2) +{ + portio_list_register(&bus->portio_list, owner, ide_portio_list, + bus, "ide", io, iobase); + portio_list_register(&bus->portio2_list, owner, ide_portio2_list, + bus, "ide", io, iobase2); +} diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 88a096f9df..79db902505 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -629,6 +629,8 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDED= riveKind kind, void ide_init2(IDEBus *bus, qemu_irq irq); void ide_exit(IDEState *s); int ide_init_ioport_isa(IDEBus *bus, ISADevice *isa, int iobase, int iobas= e2); +void ide_init_ioport(IDEBus *bus, Object *owner, MemoryRegion *io, + int iobase, int iobase2); void ide_register_restart_cb(IDEBus *bus); =20 void ide_exec_cmd(IDEBus *bus, uint32_t val); --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814974; cv=none; d=zohomail.com; s=zohoarc; b=e2Ub6eSNViv93MbdXCcTWilTmclXNvl7xzv9Kn58fFgqi8zpUrc32WEFkA0+gQxAUMaXTJ1CcULgxotST1ps9rW8lMwwrXUq9Bx/k7yrogStIo3oKwZ3tGBiBJqaGlAIgtx0wgvH/cBjhi1uhhCKitVAO1un8iOGAJ3ROZnYNfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814974; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=FbTFZyFZ3SM7zK+/KWgB50T/UucQyf86RgKkXKBXU7Xy0f4lQk9xEOpK9qtqB42pqn3DaUJfmUFsq3NzVZmFoYYVEzLBrBJ60QDoMYNVtcC3aqRdZ4POBFRFAXwTh8nt8TYcLwRTSZnwdrGOmy6zh/do8ORFcOf4r36yYc0iFoI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814974308637.9770891243403; Tue, 7 Feb 2023 16:09:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0u-0005kI-Gx; Tue, 07 Feb 2023 19:08:40 -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 1pPY0t-0005iO-6A for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:39 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008Tt-AY for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:38 -0500 Received: by mail-wr1-x434.google.com with SMTP id h16so15165199wrz.12 for ; Tue, 07 Feb 2023 16:08:14 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l4-20020adff484000000b002c3ed120cf8sm4975045wro.61.2023.02.07.16.08.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:12 -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=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=yXL4BqCfFe9IFC+dxPqn3+KW66QtcTHRWOM77VSC9Rub9DevrR852DDbmTbEiBUYrr L/x1MIzUlub5vPHWLmtJo7pooTOtlJD4oq4k/iepx2zvr560HJJgvTBm5UmaIACsntzl 6beAE0huNHyFCBb1xpeTKyqMiF5yYYgeqY7Y+nGJMdBISPHdCvQu7q6aBSRWHv7QWW4/ yRUpymJd+kNgCayYLKL5W/f4D6VCj5iPCgx8Nq5Uck7AIJCno4+niidtrP6mGQb3IiCj /D7aCXBUp8JhvAdD5yxZMaTttF9VgVu3VnomJyMZxI8tTKpXVoEC4UuaVRxdOYrxxbBn cZIw== 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=fopVAIyIRlKFxEEYJZbUN+t4EvUshH8xvbQAPi6kQOU=; b=zQh4xObaIYSJzPRediSuRfBlk6bp+3HsAaiauOhk7W2IR4Br0OVsVMwXvra+lFn7TT IYfuRW5iBFKwc6OF1puVD/Vvl8O+Fad1w+itDqmO6f1c7cm3jKE7Sy64FC7UySl3PdaG PUWr6yI2GyZEAkpnWW59kT5Dk6IVzlg+Kl2iLWtOywWX/ifM4kOs9uOSsU8/eAi79Ghx x4s11MNrT/KFyjYgK7wyQR1cm/P7NQ/tXsz8Jgk/BR5Gn7Ll6gBSQhzKsEEHdkLGSaO3 VhJi9VlNoFlrK8McuzCLxWphD3bC8fgCyTNsQgGE5pbwjPuSof60S1FUn07iE7FwSRTf uyHg== X-Gm-Message-State: AO0yUKVCFtTPBb/0mdElioIJHyssgvDDH1IA1QODI44JOwkkkfjf7wtT YN5npemJv0MHs53o7KsOnFlhOAlr9H1PUj5s X-Google-Smtp-Source: AK7set+ufZE4hqb3Rz9Hh1pIeXhnnl4GV6N1rygy7cfgwnEOE7MX6WkS0d+WQHZkDGA40oDLLTI+4w== X-Received: by 2002:adf:fb82:0:b0:2bf:dab7:8f9f with SMTP id a2-20020adffb82000000b002bfdab78f9fmr3617454wrr.65.1675814893048; Tue, 07 Feb 2023 16:08:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/7] hw/ide/piix: Use generic ide_init_ioport() Date: Wed, 8 Feb 2023 01:07:41 +0100 Message-Id: <20230208000743.79415-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814974773100001 TYPE_PIIX3_IDE is a PCI function inheriting from QOM TYPE_PCI_DEVICE. To be able to call the ISA specific ide_init_ioport_isa(), we call this function passing a NULL ISADevice argument. Remove this hack by calling the recently added generic ide_init_ioport(), which doesn't expect any ISADevice. Inspired-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ide/piix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a587541bb2..1cd4389611 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -136,15 +136,13 @@ static int pci_piix_init_ports(PCIIDEState *d) {0x1f0, 0x3f6, 14}, {0x170, 0x376, 15}, }; - int i, ret; + int i; =20 for (i =3D 0; i < 2; i++) { ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret =3D ide_init_ioport_isa(&d->bus[i], NULL, - port_info[i].iobase, port_info[i].iobase= 2); - if (ret) { - return ret; - } + ide_init_ioport(&d->bus[i], OBJECT(d), + pci_address_space_io(PCI_DEVICE(d)), + port_info[i].iobase, port_info[i].iobase2); ide_init2(&d->bus[i], isa_get_irq(NULL, port_info[i].isairq)); =20 bmdma_init(&d->bus[i], &d->bmdma[i], d); --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814996; cv=none; d=zohomail.com; s=zohoarc; b=IGm3QIi4vRtqGhOST+C/s7/B04gAfef+rlcbEw6ZV8uMHO3GG0GFzNSWkJQnubKaVDfY0iWiKjwqqki73RBfqajyEuru2p2+X0ROlmDSCoc52GOsIeUxrvRQCSDT0xmvrI7TJ6CwwpU50I+CNfpDQSa7QkZRsP9PrYkEETr8bv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814996; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=EwDtFKxq1+mAbbNrNH1KzZiZfvldevyop9PBWUKrmXzWmNrVU15sc3qoD4MBrwpxX3VJLhvtB9OvpCSVWVGY7/gnBcC9pwAhlBog9GSiWXhpjDRsktkc7tU1mY24Tyhe5SZu/uC6XzGHftrV1wZVpEZjpSkmYCkZfMx+IwrQnXk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814996281491.30215975673457; Tue, 7 Feb 2023 16:09:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0t-0005j6-If; Tue, 07 Feb 2023 19:08:39 -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 1pPY0r-0005dx-OV for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008UA-4m for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:37 -0500 Received: by mail-wr1-x435.google.com with SMTP id bk16so15169322wrb.11 for ; Tue, 07 Feb 2023 16:08:19 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id r6-20020a5d4986000000b002bfc24e1c55sm12145081wrq.78.2023.02.07.16.08.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:17 -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=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=stgA1RjcwivJZ3RRONhjsEOyqE4DR0Prn/WEq0ksnxdRtrf6/xKiXte6WZ3JPdSkWA u4vWxEx5o95hhjRHKFE1IXxkSDW/saYEsR34hQ/TtNoak/CmtW4ARiHpvTbKkV6N9kcf sDDUcqz1IAvM6ZhVDRKgvfI8HK2Dtx1jX8CGbY+m8vP4HIGICHG/RCn0zcC7SUXktS+T ZDVn7gfIUAB/EXrn/JTqr7BQ5pEGxw0IQlrEpS4Y3+TS9cah80VvUyZ0p+1XtxZQ7xcr dEjkLMp/cMb5kF5LEJp9GpOvuuwcqcAx+fJA9/6xKSHcUI8Uz0R4l9pCmyMyVhrxXhKS vL4g== 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=sg0r6PGoxk1gksSrk3lmpIJquA29NN0p4VPmWvLuBck=; b=G+eTu19CO+HTc/uJfiq1+qSbfiEEWE+mLez0wM2jlH2FBrbdknUypsumbmh+kfFp+Z dOPklEsMDbP0mFYaogepwZGLePcu0RXm0TyP0HRvqpYNvCMGNJRevH7JWmYF6MUP4x45 ZVUzbYxsTyM3xLwVy4tMEs4G0vjiCky3oeym4iiPiQTTHEDymaxztTCNK861C2bT8DhF tDapDPf8vzu0H5Jbt11XOLlbnZO3FcwU79TGr31Rdd/RVHMuQRlgdj/lHqNd0tUUlegL xzSWEsszssOiHz12X9vu3ZnQ7lPb6jRdmL0KFFZQ6VfJ396upQRwNHY0NmczRVIVjFrA ENqg== X-Gm-Message-State: AO0yUKUR2Te3nlQcNUbuF910qCPUlO2T5+zz5gmdi2NMJyCiWkRb9lAM cikDjp9nKSIdmpkE2MMF2gSG51RunG70To4v X-Google-Smtp-Source: AK7set+wvOLG4m2eIautZaPam1zZPq7MFHAKf6e8cP1FMs9zBQkgLGkf/G1XqfULcd/VnUxGuvbDTw== X-Received: by 2002:a05:6000:10a:b0:2bf:9656:d1a8 with SMTP id o10-20020a056000010a00b002bf9656d1a8mr440178wrx.32.1675814898407; Tue, 07 Feb 2023 16:08:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/7] hw/isa: Assert isa_register_portio_list() gets non-NULL ISA device Date: Wed, 8 Feb 2023 01:07:42 +0100 Message-Id: <20230208000743.79415-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814996882100005 The previous commit removed the single call to isa_register_portio_list() with dev=3DNULL. To be sure we won't reintroduce such weird (ab)use, add an assertion. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/isa/isa-bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 95fc1ba5f7..3d1996c115 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -107,7 +107,7 @@ IsaDma *isa_get_dma(ISABus *bus, int nchan) =20 static inline void isa_init_ioport(ISADevice *dev, uint16_t ioport) { - if (dev && (dev->ioport_id =3D=3D 0 || ioport < dev->ioport_id)) { + if (dev->ioport_id =3D=3D 0 || ioport < dev->ioport_id) { dev->ioport_id =3D ioport; } } @@ -123,6 +123,8 @@ int isa_register_portio_list(ISADevice *dev, const MemoryRegionPortio *pio_start, void *opaque, const char *name) { + assert(dev); + if (!isabus) { return -ENODEV; } --=20 2.38.1 From nobody Sat May 18 02:55:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675814992; cv=none; d=zohomail.com; s=zohoarc; b=avdRIX2hvItMqHbfFKmuNm80fel2Dlcmc6Z6bbAorzh+jXEr8J2AeBbMZFkab9wM36EfMPUx7yTWE2opKwLclmmEWnRYCsfHehMK0BAGDClyzuWhFBP7XFQcu9qUUhadWrJ26k7/CywLogovuaTOzoerguJ36YZ863gmn63GI34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675814992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=Rg4wIH/Mbj2nuGOQ7b7t8YofPU2+RZUthusFAk+QYaqjLILBFOQ9yOG6ivXZk9xhLH+x0YYHFedsPJc798F2xX/PR4aTpe2JJCOHVCGRhh8HSuyBglbJy7HvOjKLctviSWiRqi96r8HJUtcvJzcZiaFV7/WVSpn9x8I8OmOwh1E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675814992817809.9580836553694; Tue, 7 Feb 2023 16:09:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPY0x-0005mQ-QO; Tue, 07 Feb 2023 19:08:43 -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 1pPY0u-0005kQ-J7 for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPY0q-0008UZ-Cb for qemu-devel@nongnu.org; Tue, 07 Feb 2023 19:08:40 -0500 Received: by mail-wr1-x436.google.com with SMTP id i5so8016321wrc.0 for ; Tue, 07 Feb 2023 16:08:25 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id i3-20020a5d5223000000b002bfae1398bbsm12318666wra.42.2023.02.07.16.08.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 07 Feb 2023 16:08:23 -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=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=Oe1MMWaKLYwu+0LOyXn1IC0dNlTgroAGOtIk+aVSbrguok+HXHBBqAKr9x9vPdMLc1 O6CF04HcWt33HYLATMWuV7pmz8bxvVlbQXjiXTUXo8peVntoSMkCJmpl5fXx3At34SSc MywMR7FY1Ed4YornA+emY96LfrCmySCgsuy7VbfcCdTCvtolQAu9OqrUrq8aPcZaFyZR igs3GPzRlgOcYNNPUQll2nC/NyJ+fEB2pVdjsAzDA5ydbbC1BCcr9ANbxRF3gz4Q/s9r nAkcmJZVdhN3KWjnRrBJO4dVYaYueu+fXn+mY6vFNRW3OyoIhbZ0iQjjKU0qj1j8ZpqK R0QQ== 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=uNIF4djSxUYnm/AbMKC463cXHq46lEXK87Wn0R/Xyf0=; b=DFt7K1+SyNYaWjkBjalmnjwLzYAwbpBvdgEnPjjo7iz/fr39H8TpspHssxq1xidQyX Kkx7BDzUnmNW9rxRRNIl16BWAx/QNu9wPQbdU63IZThChs9bHXwODTKEjO/Y73UZBKGD Xhxw67gcp+9qdKbbfCv5W4XxNl1tL2ZFNC5ciRs0kgrA9Ei8bsM5/MBfq034zdEcQzkj CN+0lXM25pF6Q2PQxKNDpiiRwUKo2sQPEfqCU1xQ38O0+Qj5dGlZPl7fpayGtnCeOUMH EOC2yMqjCPa++nhX90skfgj5CpziAqDGOKmSXo1vZFiC027l6Hn7eM/79fh1M/hg9cFe ueEA== X-Gm-Message-State: AO0yUKVtFpGE30m6F9HiHgFV9uuSNV5JcqsDAR505h8By21rOI2SCmio tG/OmS7PCYyg8pt4y4l0NyPZOQxHb16y2dqh X-Google-Smtp-Source: AK7set+DLu0hEUZ7H6xrWz9NQpT7MhjdbxpDR5xltGOHf6iD/KUY6lRrY1pmLPdw1uZThXhZ98JY0g== X-Received: by 2002:a05:6000:1141:b0:2c3:db5b:727d with SMTP id d1-20020a056000114100b002c3db5b727dmr5176917wrx.53.1675814903639; Tue, 07 Feb 2023 16:08:23 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Paolo Bonzini , qemu-block@nongnu.org, Bernhard Beschow , Mark Cave-Ayland , John Snow , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 7/7] hw/ide/piix: Remove dead code in pci_piix_init_ports() Date: Wed, 8 Feb 2023 01:07:43 +0100 Message-Id: <20230208000743.79415-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208000743.79415-1-philmd@linaro.org> References: <20230208000743.79415-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675814994853100003 pci_piix_init_ports() always return '0' so can't fail. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/ide/piix.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 1cd4389611..54d545ce3a 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -126,7 +126,7 @@ static void piix_ide_reset(DeviceState *dev) pci_set_byte(pci_conf + 0x20, 0x01); /* BMIBA: 20-23h */ } =20 -static int pci_piix_init_ports(PCIIDEState *d) +static void pci_piix_init_ports(PCIIDEState *d) { static const struct { int iobase; @@ -149,15 +149,12 @@ static int pci_piix_init_ports(PCIIDEState *d) d->bmdma[i].bus =3D &d->bus[i]; ide_register_restart_cb(&d->bus[i]); } - - return 0; } =20 static void pci_piix_ide_realize(PCIDevice *dev, Error **errp) { PCIIDEState *d =3D PCI_IDE(dev); uint8_t *pci_conf =3D dev->config; - int rc; =20 pci_conf[PCI_CLASS_PROG] =3D 0x80; // legacy ATA mode =20 @@ -166,11 +163,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error= **errp) =20 vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_pci, d); =20 - rc =3D pci_piix_init_ports(d); - if (rc) { - error_setg_errno(errp, -rc, "Failed to realize %s", - object_get_typename(OBJECT(dev))); - } + pci_piix_init_ports(d); } =20 static void pci_piix_ide_exitfn(PCIDevice *dev) --=20 2.38.1