All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>,
	qemu-s390x@nongnu.org, qemu-ppc@nongnu.org,
	Pierrick Bouvier <pierrick.bouvier@linaro.org>,
	qemu-riscv@nongnu.org, qemu-arm@nongnu.org
Subject: Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean
Date: Wed, 22 Jan 2025 10:45:37 +0000	[thread overview]
Message-ID: <Z5DMUVoEcaO4Mzp2@redhat.com> (raw)
In-Reply-To: <20250122103223.55523-1-philmd@linaro.org>

On Wed, Jan 22, 2025 at 11:32:23AM +0100, Philippe Mathieu-Daudé wrote:
> As Daniel mentioned:
> 
>  "The number of instances of MachineClass is not large enough
>   that we save a useful amount of memory through bitfields."
> 
> Also, see recent commit ecbf3567e21 ("docs/devel/style: add a
> section about bitfield, and disallow them for packed structures").

Also developers incorrectly think these are already booleans:

$ git grep  -E '\b(no_parallel|no_serial|no_floppy|no_cdrom|no_sdcard|pci_allow_0_address|legacy_fw_cfg_order)\b' | grep -E '(true|false)'
hw/arm/sbsa-ref.c:    mc->pci_allow_0_address = true;
hw/arm/virt.c:    mc->pci_allow_0_address = true;
hw/arm/xlnx-versal-virt.c:    mc->no_cdrom = true;
hw/m68k/next-cube.c:    mc->no_cdrom = true;
hw/ppc/spapr.c:    mc->pci_allow_0_address = true;
hw/riscv/virt.c:    mc->pci_allow_0_address = true;

> 
> Convert the MachineClass bitfields used as boolean as real ones.
> 
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  include/hw/boards.h        | 14 +++++++-------
>  hw/arm/aspeed.c            |  6 +++---
>  hw/arm/fby35.c             |  4 ++--
>  hw/arm/npcm7xx_boards.c    |  6 +++---
>  hw/arm/raspi.c             |  6 +++---
>  hw/arm/sbsa-ref.c          |  2 +-
>  hw/arm/virt.c              |  2 +-
>  hw/arm/xilinx_zynq.c       |  2 +-
>  hw/avr/arduino.c           |  6 +++---
>  hw/core/null-machine.c     | 10 +++++-----
>  hw/i386/microvm.c          |  2 +-
>  hw/i386/pc_piix.c          |  2 +-
>  hw/i386/pc_q35.c           |  4 ++--
>  hw/loongarch/virt.c        |  2 +-
>  hw/m68k/virt.c             |  6 +++---
>  hw/ppc/pnv.c               |  2 +-
>  hw/ppc/spapr.c             |  2 +-
>  hw/riscv/virt.c            |  2 +-
>  hw/s390x/s390-virtio-ccw.c |  8 ++++----
>  hw/xtensa/sim.c            |  2 +-
>  20 files changed, 45 insertions(+), 45 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-01-22 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22 10:32 [PATCH] hw/boards: Convert MachineClass bitfields to boolean Philippe Mathieu-Daudé
2025-01-22 10:45 ` Daniel P. Berrangé [this message]
2025-01-22 12:13 ` BALATON Zoltan
2025-01-22 12:34 ` Thomas Huth
2025-01-22 14:33   ` Peter Maydell
2025-01-22 15:27     ` Thomas Huth
2025-01-22 16:58       ` Philippe Mathieu-Daudé
2025-01-22 17:41 ` Pierrick Bouvier

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=Z5DMUVoEcaO4Mzp2@redhat.com \
    --to=berrange@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@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 \
    --cc=thuth@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.