update-linux-headers: strip endianness-aware __counted_by
PATCH 1/1 update-linux-headers: strip endianness-aware __counted_by
Deal with the endianness-aware __counted_by_be() and __counted_by_le() annotations in Linux headers just like with __counted_by(): stripping them.
--- scripts/update-linux-headers.sh | 2 ++ 1 file changed, 2 insertions(+)
scripts/update-linux-headers.sh +2 -0
@@ -92,6 +92,8 @@ cp_portable() { -e "$arch_cmd" \ -e 's/__bitwise//' \ -e 's/__counted_by(\w*)//' \ + -e 's/__counted_by_be(\w*)//' \ + -e 's/__counted_by_le(\w*)//' \ -e 's/__attribute__((packed))/QEMU_PACKED/' \ -e 's/__inline__/inline/' \ -e 's/__BITS_PER_LONG/HOST_LONG_BITS/' \
Signature · 1 line
2.56.0
Quoted 8 lines · Francesco Valla
Deal with the endianness-aware
__counted_by_be()and__counted_by_le()annotations in Linux headers just like with__counted_by(): stripping them.Signed-off-by Francesco Valla <[email protected]>--- scripts/update-linux-headers.sh | 2 ++ 1 file changed, 2 insertions(+)
For virtio-can, I guess?
Quoted 6 lines
scripts/update-linux-headers.sh +0
-0
scripts/update-linux-headers.sh cp_portable() { · line 99
Quoted 8 lines
scripts/update-linux-headers.sh +2
-0@@ -92,6 +92,8 @@ cp_portable() { -e "$arch_cmd" \ -e 's/__bitwise//' \ -e 's/__counted_by(\w*)//' \ + -e 's/__counted_by_be(\w*)//' \ + -e 's/__counted_by_le(\w*)//' \ -e 's/__attribute__((packed))/QEMU_PACKED/' \ -e 's/__inline__/inline/' \ -e 's/__BITS_PER_LONG/HOST_LONG_BITS/' \
Not sure if we would want to kill all the __counted_by* birds with one stone, but let's not overthink this.
10 Nov 2026 11:31:04 Cornelia Huck <[email protected]>:
Quoted 6 lines · Francesco Valla
Quoted 5 lines
Deal with the endianness-aware
__counted_by_be()and__counted_by_le()annotations in Linux headers just like with__counted_by(): stripping them.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Francesco Valla <[email protected]>---
scripts/update-linux-headers.sh| 2 ++1 file changed, 2 insertions(+)For virtio-can, I guess?
Correct. That's the usecase that needs this at the moment.
Quoted 18 lines
Quoted 6 lines
scripts/update-linux-headers.sh +0
-0scripts/update-linux-headers.sh cp_portable() { · line 99
Quoted 8 lines
scripts/update-linux-headers.sh +2
-0@@ -92,6 +92,8 @@ cp_portable() { -e "$arch_cmd" \ -e 's/__bitwise//' \ -e 's/__counted_by(\w*)//' \ + -e 's/__counted_by_be(\w*)//' \ + -e 's/__counted_by_le(\w*)//' \ -e 's/__attribute__((packed))/QEMU_PACKED/' \ -e 's/__inline__/inline/' \ -e 's/__BITS_PER_LONG/HOST_LONG_BITS/' \Not sure if we would want to kill all the __counted_by* birds with one stone, but let's not overthink this.
Quoted 1 line
Acked-by Cornelia Huck <[email protected]>
Thank you
Regards,
Francesco