Skip to content

qemu/bswap: Let cpu_to_endian() functions handle constant expressions

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qemu/bswap: Move const_le() definitions aroundinclude/qemu/bswap.h+19 -190 replies
2/4qemu/bswap: add const_be16() and const_be32()include/qemu/bswap.h+11 -20 replies
3/4qemu/bswap: Add const_le64() and const_be64()include/qemu/bswap.h+21 -11 reply
4/4qemu/bswap: Let cpu_to_endian() functions handle constant expressionsinclude/qemu/bswap.h+6 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] qemu/bswap: Let cpu_to_endian() functions handle constant expressions

Stefan Hajnoczi suggested we can use __builtin_constant_p() in the cpu_to_ENDIAN()/ENDIAN_to_cpu() functions to check if expression is constant, and if so use the const_ENDIAN() macros.

This series modifies cpu_to_ENDIAN() to use const_ENDIAN() when possible.

Philippe Mathieu-Daudé (4):
qemu/bswap: Move const_le() definitions around
qemu/bswap: add const_be16() and const_be32()
qemu/bswap: Add const_le64() and const_be64()
qemu/bswap: Let cpu_to_endian() functions handle constant expressions

 include/qemu/bswap.h | 75 +++++++++++++++++++++++++++++++-------------
 1 file changed, 54 insertions(+), 21 deletions(-)
Signature · 1 line
2.26.2