From patchwork Tue Feb 13 08:11:54 2024 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: 772268 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp142865wre; Tue, 13 Feb 2024 00:13:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGROz4IEO7DvDP9sThrGGkgXC+8AxI9GvrqVHHr2TzGHHA4ch415pgpuSt7yjRJVhLiXIQc X-Received: by 2002:a1f:e082:0:b0:4c0:1bb6:322 with SMTP id x124-20020a1fe082000000b004c01bb60322mr4958721vkg.15.1707812029825; Tue, 13 Feb 2024 00:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707812029; cv=none; d=google.com; s=arc-20160816; b=KUYp9Zx8By7Yo4O7W9cwg5DUwY2N0oqPLsJpoPg5lhi9IJVd0d/yJRNz3JwsdvZOaa thH/cwBSScuPsgSsrzDI8x0BcjQ0ouZpDSkRRJmQs54DoefPyCeuvrgFrXZBAMZX1TKn dLF8kL9W9gVLC1vJqameFi1q3Afi/uJzL/HWP7wyejG8SkDxeb+wPDRfDs7AzwvxvUVx yBBlA3AfeOhTT9QgVSA5aJ2f91hz8R8ORzxMTuDE0OA/4RBCQGiLO+6xyQA2+FTFOSfK S65snD1wB+rpTDp72PJiks/I9RexgIGcUZyvsT5sFikxqZq0HrTgjdpdOl0zo3jD5MJn zPGw== 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=5xcNsXW9mDVOPPZyrAplUMmD9sMhDYldoYl40GQNnJE=; fh=K7bZQbWlr8sApBN1jLibRjel8vcYUEWNcKxgx8ktZso=; b=iHAueQt4ByLmWT1bs7Xk+Y/sgobKgRJrm8+b9pR4ohKC35JANnDv9IprHSITHvKi9n ohUpIBx+tw4bquZTtqpUk79LzklYH9cCF1U4hfddN2hmNeT2Smj+Uf/WXUkp43EOPPmJ nyp/4vK9lLeRkE8P4jvAlyWEqLqVYVtldTZpAsq9/cJwMoIY784/u7NjFT76akR19lZq 36p3AK+3CH0xrJnC2Tyatl0j1Q3T24Xhh2MI4G+GiLzIWMZGhakKlpguOlAQgOcwsECx mEG4W15E+NipFgy2Rb+ldAADT0SA0dlLkIDL52V5qMshpw/ZpreWc39zdVGwRrT9ALXb IhyA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bt2K0ORg; 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 X-Forwarded-Encrypted: i=1; AJvYcCVohhFOeML3bSOfwPngoNeTnhGZ8zbP+V1IqzXGM/XhqRHswGPRnm6Jm4kGLrsJbv6FG8DOQu7S8oMKJIu4J+VC Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d12-20020ac847cc000000b0042c75a66b95si2171917qtr.799.2024.02.13.00.13.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Feb 2024 00:13:49 -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=bt2K0ORg; 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 1rZnu6-0000WR-8t; Tue, 13 Feb 2024 03:12: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 1rZnu4-0000WH-I0 for qemu-devel@nongnu.org; Tue, 13 Feb 2024 03:12:32 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZntx-0000ox-RY for qemu-devel@nongnu.org; Tue, 13 Feb 2024 03:12:32 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-410db155e57so11924575e9.1 for ; Tue, 13 Feb 2024 00:12:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707811944; x=1708416744; darn=nongnu.org; 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=5xcNsXW9mDVOPPZyrAplUMmD9sMhDYldoYl40GQNnJE=; b=bt2K0ORgObQUwQ/rduDMZ9j69987lh8ykygTRCUy27yMi7+xDO4WDSGZpKMIQ1irKY ho5QbZps7BNMSMip/1xA6zlY06AULWadYXdbWD2RqNmA0f2LFtDpx9se1pMYbcrxQnQb pX2E+U32z33OVzPYDtQgPMoGAtotrsWh5P0en1c1OxzW6UHlNjB6GStDFu4MqXeul7ho ClApyxCoaydoxNiyz1f9XPNaR09cFx2oa1SrCq3R23Ab+x83FrjZs624HiaHDCFvKArE V7QJcYE2LoNW4YEPInIZL0pn5ZaDgGDT5sSPW7nsYQWnxE4ct57tvIAehDcMzealYg/z gVIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707811944; x=1708416744; 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=5xcNsXW9mDVOPPZyrAplUMmD9sMhDYldoYl40GQNnJE=; b=RfUP+JvUvDg2PTEWbBv+qShYY1g70hwoTt+d/Pxk2X5K/iG9LokO3oLp7tv/k1YEEv 9zQWH+Grm8m6MNx8WY5G0LGiAGuP13oPpapzT0O3PZwzPkZJ665MtThTAWX00rJORm7c 114gTkoXmBrwgdb/yMRES2w5/cO0R0z816ywSrxbiobr0iKN7e8d+SXzueLvj/zQpEkK pY48p7b0oTCmuN+KvdOnxETXJbaRfXQfpSqiw1i2UXOWYefiB8/7ulUBJrOTnGe4Oyn5 OTY8CmDtRQNQ29FR9e5dFmFVb2SLRi9rz0nr3+nrAjR0+FfZtGkBGPJcALfdJm6Ie1yI TIfQ== X-Gm-Message-State: AOJu0Yz42aez2SStlNqTEMX7Qo0dFtAgu4DrjGK0JpAYZeJKmIuInKWp R4ASfg2B1KtsplNzFpFgfhQXbKekyDTVXh2IlQ4tdvwnKPFKdMVQA+hiYvqqYURqHGrM1rnxvpb R X-Received: by 2002:a05:600c:c89:b0:410:888f:f342 with SMTP id fj9-20020a05600c0c8900b00410888ff342mr7260646wmb.4.1707811944206; Tue, 13 Feb 2024 00:12:24 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVNvjQ2bTAysAnkRoMSOG0D/8BnRZOKyOXKKUUDRAjHR003X98VUGsTFLG1MZRTMGHUj0MA3wj5i3qAmdxzaTWa6ynfVBwGZe/4fbu7HwBdQzILKZxcruW9IAQc78iTES5IPL6vRAxDSV9J3xLrS9lrYunSRrqof3GoWxqO7C7zbdfZOZf982xJN4tLX7P0eX6aEQ/6GWbZFQpiOnBT+ijlCTmMJgQ//q7NLry/xEni/wbV9ZWfILxMFdBRDOchW66fYjqR+yvFIUxoAlUr7jW9TbUIn+09I6g1U86Leepp1tw6HGlsQz1kQbJkKVnPMAT2GZV9IAyML9aG3nxoQ9Vp+W7i/mXv2aqY3w== Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id cc19-20020a5d5c13000000b0033b728190c1sm8318048wrb.79.2024.02.13.00.12.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 00:12:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Marcel Apfelbaum , John Snow , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , qemu-block@nongnu.org, Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paul Burton , Aleksandar Rikalo Subject: [PATCH 3/9] hw/ide/ahci: Rename AHCI PCI function as 'pdev' Date: Tue, 13 Feb 2024 09:11:54 +0100 Message-ID: <20240213081201.78951-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240213081201.78951-1-philmd@linaro.org> References: <20240213081201.78951-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We want to access AHCIPCIState::ahci field. In order to keep the code simple (avoiding &ahci->ahci), rename the current 'ahci' variable as 'pdev' Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc_q35.c | 15 ++++++++------- hw/mips/boston.c | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index ace8d3839a..e298f4ff32 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -135,7 +135,6 @@ static void pc_q35_init(MachineState *machine) GSIState *gsi_state; ISABus *isa_bus; int i; - PCIDevice *ahci; ram_addr_t lowmem; DriveInfo *hd[MAX_SATA_PORTS]; MachineClass *mc = MACHINE_GET_CLASS(machine); @@ -304,16 +303,18 @@ static void pc_q35_init(MachineState *machine) 0xff0104); if (pcms->sata_enabled) { + PCIDevice *pdev; + /* ahci and SATA device, for q35 1 ahci controller is built-in */ - ahci = pci_create_simple_multifunction(host_bus, + pdev = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_SATA1_DEV, ICH9_SATA1_FUNC), "ich9-ahci"); - idebus[0] = qdev_get_child_bus(DEVICE(ahci), "ide.0"); - idebus[1] = qdev_get_child_bus(DEVICE(ahci), "ide.1"); - g_assert(MAX_SATA_PORTS == ahci_get_num_ports(ahci)); - ide_drive_get(hd, ahci_get_num_ports(ahci)); - ahci_ide_create_devs(ahci, hd); + idebus[0] = qdev_get_child_bus(DEVICE(pdev), "ide.0"); + idebus[1] = qdev_get_child_bus(DEVICE(pdev), "ide.1"); + g_assert(MAX_SATA_PORTS == ahci_get_num_ports(pdev)); + ide_drive_get(hd, ahci_get_num_ports(pdev)); + ahci_ide_create_devs(pdev, hd); } else { idebus[0] = idebus[1] = NULL; } diff --git a/hw/mips/boston.c b/hw/mips/boston.c index cbcefdd693..0ec0b98066 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -677,7 +677,7 @@ static void boston_mach_init(MachineState *machine) MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg; MemoryRegion *sys_mem = get_system_memory(); XilinxPCIEHost *pcie2; - PCIDevice *ahci; + PCIDevice *pdev; DriveInfo *hd[6]; Chardev *chr; int fw_size, fit_err; @@ -769,11 +769,11 @@ static void boston_mach_init(MachineState *machine) qemu_chr_fe_set_handlers(&s->lcd_display, NULL, NULL, boston_lcd_event, NULL, s, NULL, true); - ahci = pci_create_simple_multifunction(&PCI_BRIDGE(&pcie2->root)->sec_bus, + pdev = pci_create_simple_multifunction(&PCI_BRIDGE(&pcie2->root)->sec_bus, PCI_DEVFN(0, 0), TYPE_ICH9_AHCI); - g_assert(ARRAY_SIZE(hd) == ahci_get_num_ports(ahci)); - ide_drive_get(hd, ahci_get_num_ports(ahci)); - ahci_ide_create_devs(ahci, hd); + g_assert(ARRAY_SIZE(hd) == ahci_get_num_ports(pdev)); + ide_drive_get(hd, ahci_get_num_ports(pdev)); + ahci_ide_create_devs(pdev, hd); if (machine->firmware) { fw_size = load_image_targphys(machine->firmware,