[Qemu-devel] [PATCH 1/7] net: struct MACAddr can use the QEMU_PACKED macro

Philippe Mathieu-Daudé posted 7 patches 7 years, 9 months ago
[Qemu-devel] [PATCH 1/7] net: struct MACAddr can use the QEMU_PACKED macro
Posted by Philippe Mathieu-Daudé 7 years, 9 months ago
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/net/net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/net.h b/include/net/net.h
index 4afac1a9dd..70f5bb3419 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -23,7 +23,7 @@
 
 struct MACAddr {
     uint8_t a[6];
-};
+} QEMU_PACKED;
 
 /* qdev nic properties */
 
-- 
2.15.1


Re: [Qemu-devel] [PATCH 1/7] net: struct MACAddr can use the QEMU_PACKED macro
Posted by Richard Henderson 7 years, 9 months ago
On 01/08/2018 10:02 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  include/net/net.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/net.h b/include/net/net.h
> index 4afac1a9dd..70f5bb3419 100644
> --- a/include/net/net.h
> +++ b/include/net/net.h
> @@ -23,7 +23,7 @@
>  
>  struct MACAddr {
>      uint8_t a[6];
> -};
> +} QEMU_PACKED;

I suppose the arm32 abi does pad structs to a multiple of 4.  Does this
actually affect anything else?

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~