diff mbox

[v3,01/11] compiler.h: add QEMU_ALIGNED() to enforce struct alignment

Message ID 1461107270-19234-2-git-send-email-cota@braap.org (mailing list archive)
State New, archived
Headers show

Commit Message

Emilio Cota April 19, 2016, 11:07 p.m. UTC
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 include/qemu/compiler.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alex Bennée April 22, 2016, 9:32 a.m. UTC | #1
Emilio G. Cota <cota@braap.org> writes:

> Reviewed-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Emilio G. Cota <cota@braap.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  include/qemu/compiler.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 8f1cc7b..1978ddc 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -41,6 +41,8 @@
>  # define QEMU_PACKED __attribute__((packed))
>  #endif
>
> +#define QEMU_ALIGNED(B) __attribute__((aligned(B)))
> +
>  #ifndef glue
>  #define xglue(x, y) x ## y
>  #define glue(x, y) xglue(x, y)


--
Alex Bennée
Peter Maydell April 22, 2016, 9:35 a.m. UTC | #2
On 20 April 2016 at 00:07, Emilio G. Cota <cota@braap.org> wrote:
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  include/qemu/compiler.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 8f1cc7b..1978ddc 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -41,6 +41,8 @@
>  # define QEMU_PACKED __attribute__((packed))
>  #endif
>
> +#define QEMU_ALIGNED(B) __attribute__((aligned(B)))

A rather trivial thing, but if we have to respin this series
for some other reason could we use a different macro parameter
than 'B', please? I had to re-read the patch carefully before
I realised that (a) it wasn't "aligned(8)" and (b) it wasn't a
typo for "aligned(8)" either...

thanks
-- PMM
Emilio Cota April 22, 2016, 3:50 p.m. UTC | #3
On Fri, Apr 22, 2016 at 10:35:42 +0100, Peter Maydell wrote:
> On 20 April 2016 at 00:07, Emilio G. Cota <cota@braap.org> wrote:
> > +#define QEMU_ALIGNED(B) __attribute__((aligned(B)))
> 
> A rather trivial thing, but if we have to respin this series
> for some other reason could we use a different macro parameter
> than 'B', please? I had to re-read the patch carefully before
> I realised that (a) it wasn't "aligned(8)" and (b) it wasn't a
> typo for "aligned(8)" either...

Heh sure, will use X.

Thanks,

		Emilio
diff mbox

Patch

diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 8f1cc7b..1978ddc 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -41,6 +41,8 @@ 
 # define QEMU_PACKED __attribute__((packed))
 #endif
 
+#define QEMU_ALIGNED(B) __attribute__((aligned(B)))
+
 #ifndef glue
 #define xglue(x, y) x ## y
 #define glue(x, y) xglue(x, y)