From patchwork Sun Feb 25 17:16:35 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: 775738 Delivered-To: patch@linaro.org Received: by 2002:adf:a356:0:b0:33b:4db1:f5b3 with SMTP id d22csp1233573wrb; Sun, 25 Feb 2024 09:18:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXxaPvcjsCi2vwmPj7XjdG4oknPhWKSbwV4pBRuNM3ZboyAjq1fRCpkW+RQ6EzJn/DyMv6Q5mHpWyGmx1mJ4w7W X-Google-Smtp-Source: AGHT+IExrNoZaK3+ugxSD48YRQ+YrmrWUJGM0AojwrOLUBQ1Pn+93nkbzJd7+vfi2tCxkTCdMZnP X-Received: by 2002:a05:622a:113:b0:42d:feeb:64df with SMTP id u19-20020a05622a011300b0042dfeeb64dfmr5810961qtw.36.1708881498987; Sun, 25 Feb 2024 09:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708881498; cv=none; d=google.com; s=arc-20160816; b=Dz59I9o9AlcYgKXi2ojCTVOkUJB3NDRtXCBtsNxaofrORTprx4sADIxJ1WBYDubVO2 0+KSjP9eVV3jTD5HgX5uc8NYpVB0qjPlpr7wmU2pm5ZvyIcIUyP0zw+kZySSmc+dWZdj 2VhaNPRbMDfMk3oyFyvStA9VKPqe/b8QfsoM/q8M0ReRvSz1UGk3fdFZCifb26Eq5VWS mqpIVOELYK8gLqjnnYW9yuTDBgZgmxiE1B8z9i67sjE0ZE5xbqJKey1KPE3UthP/g+KL GlezoprZ7Z2dHLi/hHKPW7EZtE2lqzaQyEzUaoS7LKmNGcX81/ZfpSJn3cqrC8rvPcVD TRRA== 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=cwzDlmu7+joT64q6lgoDz20T+b1NRYPG1wt4e7xF0MU=; fh=VVEokp7CVhK9laH95bwn/1/1P1PK3npn9obwhWd5NXA=; b=jK6Ne3Jevr6mgKGAf3v4S3Yc1Z/1olnCstti3eOsgbSWXcyJbpGfWvnV4c+ZMuhSs0 G5heB8tc2gK/WFyOpA4A+x1ymWjatwEYHo1GvhumaybHZGx7Vh4o1jhqAXmLRy9YkdIR Mv47K+UvN3fiQnZIkFGex0a8ZtApxDm6IA784+3VDslcJurocozs/p3hFGzakPteO7aU byeTuA/bB0tjyccbHvg57azVipeQX6zIu6+kecvp6g24npMvrlSV2zGxn9m4QGQ/9LNc b6RyOz1AuEUDVHRFBFLAVAPZfIAaufOYh4iIR7RJ7QlP3tXgWlgxyKNtIkl+EjEoY6c+ mVwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RA5Ff0ns; 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 q16-20020ac84510000000b0042e5c1b4f78si3332184qtn.762.2024.02.25.09.18.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2024 09:18:18 -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=RA5Ff0ns; 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 1reI7Q-0001tl-1s; Sun, 25 Feb 2024 12:16:52 -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 1reI7O-0001sa-Qa for qemu-devel@nongnu.org; Sun, 25 Feb 2024 12:16:50 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reI7M-0003wV-LX for qemu-devel@nongnu.org; Sun, 25 Feb 2024 12:16:50 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412a4a932f4so1526245e9.0 for ; Sun, 25 Feb 2024 09:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708881407; x=1709486207; 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=cwzDlmu7+joT64q6lgoDz20T+b1NRYPG1wt4e7xF0MU=; b=RA5Ff0nswQF68hFCVjnzAqGpfIcCUpWYAfxEh7MIafWZl7bfLl14dGPni7Oe3frnYx YBHBN+ptiGyLNnOiUPuO6oHpZFSKo/FGB6Kf+7PEJsKC5SqVrYcGnwdgShX+5d0spDn1 NojeOS8r5KCc6tqaQXwwvnIQGO7QTrkZwh/4ansm6vhTRW8HEiyQfIT/4v2y/FK6MyzA fc4fgkr+3IxUeymk5IEbEFkTpNlIazkK1qipzSZvCmy4b/81UKveri1HnI5zVxUI+5MC NO/d14eZZVn9gsmO4kv9cW5kRBRWHOi8h1n8qoeUnb3PmtJAo8K7x/zizenlZgGEXnpU rgKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708881407; x=1709486207; 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=cwzDlmu7+joT64q6lgoDz20T+b1NRYPG1wt4e7xF0MU=; b=w4K6N//WFeK+KzbtTsZwN5LQuzo5e8CaGIi3H/H1ESQ3Yqu9lB3lDRzsyhTfuuH51f Q6YFlGXiTYNMNVFBNWLMCUfZMn5tp8QzrPEb+NPTr3SKYmze9c3KOKIlQEeRzFCjXZUW mNlObKpkCqQ4NSeZ8KuxxI8r/NS9+p9htlSUPXQo4Bb7C4/qq+axvMaWMhZMTLVUlRnh WkimqBa5c/jPrurjkr/BKs3ifDUchB93QWViS63dzgbPCccmA6hUGG/B5a7/X6B3gCUk D8Yi3YGTC0rtjlwqZL7fqJYOdw+4ScGKqQO+w4tCjY39wxzMuaoCwDkyVTMqYINu+V17 qudw== X-Gm-Message-State: AOJu0Yy28iQ5WZ6qfHPnhjgT6s+Hol2a1pVbM/37Nw1gcvfdfg5AqFPR bXFlXf3QULhZwBDqVd+D9GqEVFPC3mJ+Pql3zx2dZIFsRYdPb0yTbZw9n6v99cJsB0L8toaLd36 o X-Received: by 2002:a05:600c:41c2:b0:412:9018:74ca with SMTP id t2-20020a05600c41c200b00412901874camr3943606wmh.35.1708881406794; Sun, 25 Feb 2024 09:16:46 -0800 (PST) Received: from m1x-phil.lan ([176.176.164.69]) by smtp.gmail.com with ESMTPSA id l6-20020a1c7906000000b0040fddaf9ff4sm9297419wme.40.2024.02.25.09.16.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 25 Feb 2024 09:16:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Leif Lindholm , Marcin Juszkiewicz , BALATON Zoltan , Radoslaw Biernacki , qemu-arm@nongnu.org, Peter Maydell , qemu-block@nongnu.org, John Snow , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v2 1/3] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs() Date: Sun, 25 Feb 2024 18:16:35 +0100 Message-ID: <20240225171637.4709-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240225171637.4709-1-philmd@linaro.org> References: <20240225171637.4709-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Use ahci_ide_create_devs() instead of open-coding it. Not accessing AHCIDevice internals anymore allows to remove "hw/ide/ahci_internal.h" (which isn't really a public header). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/arm/sbsa-ref.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 5d3a574664..995c7be23e 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -37,7 +37,6 @@ #include "hw/block/flash.h" #include "hw/boards.h" #include "hw/ide/internal.h" -#include "hw/ide/ahci_internal.h" #include "hw/ide/ahci-sysbus.h" #include "hw/intc/arm_gicv3_common.h" #include "hw/intc/arm_gicv3_its_common.h" @@ -572,7 +571,6 @@ static void create_ahci(const SBSAMachineState *sms) DriveInfo *hd[NUM_SATA_PORTS]; SysbusAHCIState *sysahci; AHCIState *ahci; - int i; dev = qdev_new("sysbus-ahci"); qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS); @@ -583,12 +581,7 @@ static void create_ahci(const SBSAMachineState *sms) sysahci = SYSBUS_AHCI(dev); ahci = &sysahci->ahci; ide_drive_get(hd, ARRAY_SIZE(hd)); - for (i = 0; i < ahci->ports; i++) { - if (hd[i] == NULL) { - continue; - } - ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]); - } + ahci_ide_create_devs(ahci, hd); } static void create_xhci(const SBSAMachineState *sms)