qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/9] hw/ide/ahci: Inline ahci_get_num_ports()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 4/9] hw/ide/ahci: Inline ahci_get_num_ports()
Date: Thu, 15 Feb 2024 16:25:19 +0100
User-agent: Mozilla Thunderbird

On 13/2/24 17:43, Richard Henderson wrote:
On 2/12/24 22:11, Philippe Mathieu-Daudé wrote:
Introduce the 'ich9' variable and inline ahci_get_num_ports().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/hw/ide/ahci.h | 1 -
  hw/i386/pc_q35.c      | 6 ++++--
  hw/ide/ahci.c         | 8 --------
  hw/mips/boston.c      | 6 ++++--
  4 files changed, 8 insertions(+), 13 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

As far as it goes.  But it certainly highlights that

+        g_assert(MAX_SATA_PORTS == ich9->ahci.ports);
+        ide_drive_get(hd, ich9->ahci.ports);
....
+    g_assert(ARRAY_SIZE(hd) == ich9->ahci.ports);
+    ide_drive_get(hd, ich9->ahci.ports);

ports is always a constant.  Or perhaps that's only from this PCI usage?

I'm just moving code around :)

I'm not sure about this assert, but TBH I consider ide_drive_get()
as legacy API (pre -blockdev, only 7 uses in the tree, half from old
boards).

I'll let that constant cleanup for later.

Regards,

Phil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]