diff mbox series

[v3,1/6] scripts/update-linux-headers: Update handling of __aligned_u64

Message ID 20180503214437.2749.37878.stgit@gimli.home
State New
Headers show
Series vfio/quirks: ioeventfd support | expand

Commit Message

Alex Williamson May 3, 2018, 9:44 p.m. UTC
We'll currently replace any 'u64' with a 'uint64_t' including when
it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t'
which doesn't exist.  Add another sed entry to find these and convert
them back to their original form.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 scripts/update-linux-headers.sh |    1 +
 1 file changed, 1 insertion(+)

Comments

Peter Maydell May 22, 2018, 2:04 p.m. UTC | #1
On 3 May 2018 at 22:44, Alex Williamson <alex.williamson@redhat.com> wrote:
> We'll currently replace any 'u64' with a 'uint64_t' including when
> it's embedded in an '__aligned_u64', creating a '__aligned_uint64_t'
> which doesn't exist.  Add another sed entry to find these and convert
> them back to their original form.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>  scripts/update-linux-headers.sh |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
> index a017b53d8765..dd74cc8d5223 100755
> --- a/scripts/update-linux-headers.sh
> +++ b/scripts/update-linux-headers.sh
> @@ -56,6 +56,7 @@ cp_portable() {
>          -e 's/__s\([0-9][0-9]*\)/int\1_t/g' \
>          -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \
>          -e 's/__be\([0-9][0-9]*\)/uint\1_t/g' \
> +        -e 's/__aligned_uint\([0-9][0-9]*\)_t/__aligned_u\1/g' \
>          -e 's/"\(input-event-codes\.h\)"/"standard-headers\/linux\/\1"/' \
>          -e 's/<linux\/\([^>]*\)>/"standard-headers\/linux\/\1"/' \
>          -e 's/__bitwise//' \

Hi -- I just ran into this as well, but this fix looks odd. This
bit of the script is supposed to generate portable headers,
so we need to do something with __aligned_u64; we can't just
leave it the way it is. We should presumably be turning it into
some typedef which we have a definition of in the QEMU headers.

(That u\([0-9][0-9]*\) substitution is really broad; we should
probably switch to using perl instead so we can use regexes that
match on word-boundaries so we only change what we intend to.)

thanks
-- PMM
diff mbox series

Patch

diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh
index a017b53d8765..dd74cc8d5223 100755
--- a/scripts/update-linux-headers.sh
+++ b/scripts/update-linux-headers.sh
@@ -56,6 +56,7 @@  cp_portable() {
         -e 's/__s\([0-9][0-9]*\)/int\1_t/g' \
         -e 's/__le\([0-9][0-9]*\)/uint\1_t/g' \
         -e 's/__be\([0-9][0-9]*\)/uint\1_t/g' \
+        -e 's/__aligned_uint\([0-9][0-9]*\)_t/__aligned_u\1/g' \
         -e 's/"\(input-event-codes\.h\)"/"standard-headers\/linux\/\1"/' \
         -e 's/<linux\/\([^>]*\)>/"standard-headers\/linux\/\1"/' \
         -e 's/__bitwise//' \