netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
To: linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org>,
	Marek Lindner
	<mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org>
Subject: Re: [PATCH] Fix ARM BUILD_BUG_ON() errors with batman-adv
Date: Sat, 30 Nov 2013 21:12:52 +0100	[thread overview]
Message-ID: <529A46C4.9090906@meshcoding.com> (raw)
In-Reply-To: <20131130191553.GA16735-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 30/11/13 20:15, Russell King - ARM Linux wrote:
> From: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
> 
> The following errors were observed on ARM during a randconfig
> build. This patch addresses them by ensuring that the batadv_header
> structure is appropriately packed; this structure contains three
> 8-bit elements so there should be no undesired side effect from
> this packing.
> 
> net/batman-adv/main.c: In function 'batadv_init': 
> net/batman-adv/main.c:425:279: error: call to
> '__compiletime_assert_425' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_unicast_4addr_packet,
> src) != 10 net/batman-adv/main.c:426:267: error: call to
> '__compiletime_assert_426' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_unicast_packet, dest)
> != 4 net/batman-adv/main.c:427:275: error: call to
> '__compiletime_assert_427' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_unicast_tvlv_packet,
> dst) != 4 net/batman-adv/main.c:428:261: error: call to
> '__compiletime_assert_428' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_frag_packet, dest) !=
> 4 net/batman-adv/main.c:429:271: error: call to
> '__compiletime_assert_429' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_icmp_packet, icmph.dst)
> != 4 net/batman-adv/main.c:430:277: error: call to
> '__compiletime_assert_430' declared with attribute error:
> BUILD_BUG_ON failed: offsetof(struct batadv_icmp_packet_rr,
> icmph.dst) != 4
> 
> Signed-off-by: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> --- 
> net/batman-adv/packet.h |    2 +- 1 files changed, 1 insertions(+),
> 1 deletions(-)
> 
> diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h 
> index 207459b62966..4039f25794e0 100644 ---
> a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h @@ -171,7
> +171,7 @@ struct batadv_header { /* the parent struct has to add a
> byte after the header to make * everything 4 bytes aligned again 
> */ -}; +} __attribute__((packed));

Russell,

this attribute was there in the past and then was removed on purpose
because on some architectures it makes the compiler generating very
inefficient code (you can check
http://article.gmane.org/gmane.org.freifunk.batman/8317 for more details).

So we removed the __packed attribute and we took care of properly
aligning all the structures by adding "alignment/reserved members"
when needed.

I don't know the ARM architecture at all (I don't know if the other
batman-adv developers do), so could you please provide here some more
details about why that static check is failing? We would like to
address this issue differently rather than re-adding the __packed
attribute.


Thanks a lot.

Best Regards,


- -- 
Antonio Quartulli
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlKaRsQACgkQpGgxIkP9cwdDnACeJGU2FXi48yjDwZ2YcPCJBruq
vKgAnRc4p1dukczVgFATo2wb+Bflpdom
=RrAs
-----END PGP SIGNATURE-----

  parent reply	other threads:[~2013-11-30 20:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-30 19:15 [PATCH] Fix ARM BUILD_BUG_ON() errors with batman-adv Russell King - ARM Linux
     [not found] ` <20131130191553.GA16735-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-11-30 20:12   ` Antonio Quartulli [this message]
2013-11-30 23:05     ` [B.A.T.M.A.N.] " Russell King - ARM Linux
     [not found]       ` <20131130230518.GC16735-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-12-01  0:27         ` Antonio Quartulli
2013-12-01 14:28           ` [B.A.T.M.A.N.] " Antonio Quartulli
2013-12-01 17:13             ` Russell King - ARM Linux
2013-12-02 10:24               ` [B.A.T.M.A.N.] [PATCH] Fix ARM BUILD_BUG_ON() errors withbatman-adv David Laight
2013-12-02 12:50                 ` Antonio Quartulli
2013-12-02 13:10                   ` David Laight
2013-12-02 16:20                   ` David Miller
     [not found]             ` <529B47AA.8060403-x4xJYDvStAgysxA8WJXlww@public.gmane.org>
2013-12-01 19:21               ` [PATCH] Fix ARM BUILD_BUG_ON() errors with batman-adv David Miller
2013-12-01 20:40                 ` [B.A.T.M.A.N.] " Antonio Quartulli
2013-11-30 21:05 ` David Miller
2013-11-30 23:03   ` Russell King - ARM Linux
     [not found]   ` <20131130.160547.837987320410619405.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-12-02 17:58     ` Simon Wunderlich
     [not found]       ` <201312021858.48074.sw-2YrNx6rUIHYiY0qSoAWiAoQuADTiUCJX@public.gmane.org>
2013-12-02 18:38         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=529A46C4.9090906@meshcoding.com \
    --to=antonio-x4xjydvstagysxa8wjxlww@public.gmane.org \
    --cc=b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=mareklindner-rVWd3aGhH2z5bpWLKbzFeg@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).