[PATCH v2 0/4] bswap: Cleanups around 'qemu/bswap.h' header

Philippe Mathieu-Daudé posted 4 patches 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260109164742.58041-1-philmd@linaro.org
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Ari Sundholm <ari@tuxera.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Xie Yongji <xieyongji@bytedance.com>, Coiby Xu <Coiby.Xu@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, "Denis V. Lunev" <den@openvz.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Greg Kurz <groug@kaod.org>, John Snow <jsnow@redhat.com>, Pavel Pisa <pisa@cmp.felk.cvut.cz>, Francisco Iglesias <francisco.iglesias@amd.com>, Vikram Garhwal <vikram.garhwal@bytedance.com>, Jason Wang <jasowang@redhat.com>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Bin Meng <bmeng.cn@gmail.com>, Michael Roth <michael.roth@amd.com>, Kostiantyn Kostiuk <kkostiuk@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, "Cédric Le Goater" <clg@kaod.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Peter Xu <peterx@redhat.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Aditya Gupta <adityag@linux.ibm.com>, Glenn Miles <milesg@linux.ibm.com>, Gautam Menghani <gautam@linux.ibm.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Jeuk Kim <jeuk20.kim@samsung.com>, Eric Blake <eblake@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block/qcow2.h                         | 1 +
include/qemu/host-utils.h             | 7 +++----
include/qemu/int128.h                 | 7 +++----
tests/qtest/pnv-xive2-common.h        | 1 -
audio/audio.c                         | 1 +
block/blklogwrites.c                  | 1 +
block/export/vduse-blk.c              | 1 +
block/export/vhost-user-blk-server.c  | 1 +
block/export/virtio-blk-handler.c     | 1 +
block/parallels-ext.c                 | 1 +
hw/9pfs/9p-local.c                    | 1 +
hw/block/cdrom.c                      | 1 +
hw/block/hd-geometry.c                | 1 +
hw/net/can/ctucan_core.c              | 1 +
hw/nvram/xlnx-efuse.c                 | 1 +
hw/scsi/scsi-generic.c                | 1 +
hw/sd/sd.c                            | 1 +
hw/sd/ssi-sd.c                        | 1 +
net/l2tpv3.c                          | 1 +
qga/commands-linux.c                  | 1 +
scsi/pr-manager-helper.c              | 1 +
target/arm/tcg/arith_helper.c         | 1 +
tests/qtest/acpi-utils.c              | 1 +
tests/qtest/ahci-test.c               | 2 +-
tests/qtest/aspeed-hace-utils.c       | 1 +
tests/qtest/aspeed_smc-test.c         | 1 -
tests/qtest/ast2700-smc-test.c        | 1 -
tests/qtest/bios-tables-test.c        | 1 +
tests/qtest/libqos/ahci.c             | 2 +-
tests/qtest/libqos/fw_cfg.c           | 1 -
tests/qtest/libqos/generic-pcihost.c  | 2 +-
tests/qtest/libqos/i2c-omap.c         | 1 -
tests/qtest/libqos/igb.c              | 1 +
tests/qtest/libqos/pci-spapr.c        | 2 +-
tests/qtest/libqos/virtio-9p-client.c | 1 +
tests/qtest/migration/framework.c     | 1 +
tests/qtest/npcm7xx_emc-test.c        | 1 +
tests/qtest/pnv-spi-seeprom-test.c    | 1 -
tests/qtest/tpm-emu.c                 | 1 +
tests/qtest/ufs-test.c                | 1 +
tests/qtest/vmgenid-test.c            | 1 +
tests/unit/test-hbitmap.c             | 1 +
util/bitmap.c                         | 1 +
util/hbitmap.c                        | 2 +-
44 files changed, 42 insertions(+), 19 deletions(-)
[PATCH v2 0/4] bswap: Cleanups around 'qemu/bswap.h' header
Posted by Philippe Mathieu-Daudé 4 weeks ago
The point of this cleanup series is to avoid a circular dependency
problem between "qemu/bswap.h" and "exec/memop.h", since I want
to add a ld/st variant in "qemu/bswap.h" that takes a MemOp arg.

Otherwise I get:

    In file included from ../../util/qemu-timer-common.c:25:
    In file included from include/qemu/timer.h:4:
    In file included from include/qemu/bitops.h:16:
    In file included from include/qemu/host-utils.h:33:
    In file included from include/qemu/bswap.h:6:
    include/exec/memop.h:182:19: error: call to undeclared function 'ctz32'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      182 |     return (MemOp)ctz32(size);
          |                   ^
    In file included from ../../util/qemu-timer-common.c:25:
    In file included from include/qemu/timer.h:4:
    In file included from include/qemu/bitops.h:16:
    include/qemu/host-utils.h:236:19: error: static declaration of 'ctz32' follows non-static declaration
      236 | static inline int ctz32(uint32_t val)
          |                   ^
    include/exec/memop.h:182:19: note: previous implicit declaration is here
      182 |     return (MemOp)ctz32(size);
          |                   ^
    2 errors generated.

Philippe Mathieu-Daudé (4):
  tests/qtest: Remove unnecessary 'qemu/bswap.h' include
  bswap: Use 'qemu/bswap.h' instead of 'qemu/host-utils.h'
  bswap: Include missing 'qemu/bswap.h' header
  bswap: Consistently use builtin bswap() functions

 block/qcow2.h                         | 1 +
 include/qemu/host-utils.h             | 7 +++----
 include/qemu/int128.h                 | 7 +++----
 tests/qtest/pnv-xive2-common.h        | 1 -
 audio/audio.c                         | 1 +
 block/blklogwrites.c                  | 1 +
 block/export/vduse-blk.c              | 1 +
 block/export/vhost-user-blk-server.c  | 1 +
 block/export/virtio-blk-handler.c     | 1 +
 block/parallels-ext.c                 | 1 +
 hw/9pfs/9p-local.c                    | 1 +
 hw/block/cdrom.c                      | 1 +
 hw/block/hd-geometry.c                | 1 +
 hw/net/can/ctucan_core.c              | 1 +
 hw/nvram/xlnx-efuse.c                 | 1 +
 hw/scsi/scsi-generic.c                | 1 +
 hw/sd/sd.c                            | 1 +
 hw/sd/ssi-sd.c                        | 1 +
 net/l2tpv3.c                          | 1 +
 qga/commands-linux.c                  | 1 +
 scsi/pr-manager-helper.c              | 1 +
 target/arm/tcg/arith_helper.c         | 1 +
 tests/qtest/acpi-utils.c              | 1 +
 tests/qtest/ahci-test.c               | 2 +-
 tests/qtest/aspeed-hace-utils.c       | 1 +
 tests/qtest/aspeed_smc-test.c         | 1 -
 tests/qtest/ast2700-smc-test.c        | 1 -
 tests/qtest/bios-tables-test.c        | 1 +
 tests/qtest/libqos/ahci.c             | 2 +-
 tests/qtest/libqos/fw_cfg.c           | 1 -
 tests/qtest/libqos/generic-pcihost.c  | 2 +-
 tests/qtest/libqos/i2c-omap.c         | 1 -
 tests/qtest/libqos/igb.c              | 1 +
 tests/qtest/libqos/pci-spapr.c        | 2 +-
 tests/qtest/libqos/virtio-9p-client.c | 1 +
 tests/qtest/migration/framework.c     | 1 +
 tests/qtest/npcm7xx_emc-test.c        | 1 +
 tests/qtest/pnv-spi-seeprom-test.c    | 1 -
 tests/qtest/tpm-emu.c                 | 1 +
 tests/qtest/ufs-test.c                | 1 +
 tests/qtest/vmgenid-test.c            | 1 +
 tests/unit/test-hbitmap.c             | 1 +
 util/bitmap.c                         | 1 +
 util/hbitmap.c                        | 2 +-
 44 files changed, 42 insertions(+), 19 deletions(-)

-- 
2.52.0