From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-riscv@nongnu.org,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH-for-10.0 v2 01/13] hw/pci: Do not declare PCIBus::flags mask as enum
Date: Wed, 4 Dec 2024 07:49:53 +0100 [thread overview]
Message-ID: <d24c3fb5-4edd-491d-b651-a13a1f7aacec@redhat.com> (raw)
In-Reply-To: <ab884d96-6648-4888-962c-35a6b1d90857@linaro.org>
On 27/11/2024 10.37, Philippe Mathieu-Daudé wrote:
> On 26/11/24 12:22, Philippe Mathieu-Daudé wrote:
>> We use PCIBus::flags to mask various flags. It is not
>> an enum, and doing so confuses static analyzers. Rename
>> the enum as singular. Use a generic unsigned type for
>> the mask.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> include/hw/pci/pci_bus.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h
>> index 22613125462..6ecfe2e06d5 100644
>> --- a/include/hw/pci/pci_bus.h
>> +++ b/include/hw/pci/pci_bus.h
>> @@ -19,7 +19,7 @@ struct PCIBusClass {
>> uint16_t (*numa_node)(PCIBus *bus);
>> };
>> -enum PCIBusFlags {
>> +enum PCIBusFlag {
>> /* This bus is the root of a PCI domain */
>> PCI_BUS_IS_ROOT = 0x0001,
>> /* PCIe extended configuration space is accessible on this bus */
>
> (more diff context:)
>
> PCI_BUS_EXTENDED_CONFIG_SPACE = 0x0002,
> /* This is a CXL Type BUS */
> PCI_BUS_CXL = 0x0004,
>
> Enum would be the [0, 1, 2] bits. Since we define bitmask and use
> bitmask arguments in the code, shouldn't we simply replace that
> enum by #define?
Agreed, this rather sounds like #defines than an enum to me, too.
Thomas
next prev parent reply other threads:[~2024-12-04 6:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 11:21 [PATCH-for-10.0 v2 00/13] hw/boards: Remove legacy MachineClass::pci_allow_0_address flag Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 01/13] hw/pci: Do not declare PCIBus::flags mask as enum Philippe Mathieu-Daudé
2024-11-27 9:37 ` Philippe Mathieu-Daudé
2024-12-04 6:49 ` Thomas Huth [this message]
2024-11-26 11:22 ` [PATCH-for-10.0 v2 02/13] hw/pci-bridge: Initialize bridge with parent bus flags Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 03/13] hw/pci: Factor machine_refuses_bar_at_addr_0() helper out Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 04/13] hw/pci: Introduce PCIBusFlag::PCI_BUS_BAR_AT_ADDR0_REFUSED Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 05/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_internal_init() Philippe Mathieu-Daudé
2024-12-05 16:44 ` Peter Maydell
2024-12-05 21:24 ` Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 06/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_init() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 07/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_new() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 08/13] hw/pci: Propagate bar_at_addr_0_refused to pci_register_root_bus() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 09/13] hw/ppc/spapr: Create host bridge setting bar_at_addr_0_refused=false Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 10/13] hw/pci-host/gpex: Expose 'refuse-bar-at-addr-0' property Philippe Mathieu-Daudé
2024-12-05 16:47 ` Peter Maydell
2024-12-05 21:25 ` Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 11/13] hw/arm/virt: Create GPEX host bridge without refuse-bar-at-addr-0 Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 12/13] hw/riscv/virt: " Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 13/13] hw/pci/pci: Remove legacy MachineClass::pci_allow_0_address flag Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d24c3fb5-4edd-491d-b651-a13a1f7aacec@redhat.com \
--to=thuth@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).