LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Gordon Farquharson" <gordonfarquharson@gmail.com>
To: "Michael Buesch" <mb@bu3sch.de>
Cc: "Sam Ravnborg" <sam@ravnborg.org>,
	"Russell King" <rmk+lkml@arm.linux.org.uk>,
	linux-kernel@vger.kernel.org, linville@tuxdriver.com,
	stefano.brivio@polimi.it, "Linus Torvalds" <torvalds@osdl.org>,
	"Andrew Morton" <akpm@osdl.org>,
	viro@ftp.linux.org.uk
Subject: Re: [RFC] [PATCH] Fix b43 driver build for arm
Date: Sat, 23 Feb 2008 03:14:23 -0700	[thread overview]
Message-ID: <97a0a9ac0802230214w6e6fe469q8e8a5597833aac33@mail.gmail.com> (raw)
In-Reply-To: <200802230651.10376.mb@bu3sch.de>

On Fri, Feb 22, 2008 at 10:51 PM, Michael Buesch <mb@bu3sch.de> wrote:
>  A big fat comment is something like that:
>
>  /* Explicit padding to support a broken sanity check in file2alias.c.
>   * The check will compare the size of the structure in the kernel
>   * object file to the userspace the kernel is compiled on.
>   * This breaks on cross-compilation. This padding is a workaround
>   * for this. */

---

Align the members of the SSB device structure to a 32 bit boundary so
that the b43 driver can be built for arm using a cross compiler. This
alignment is required so that the test in scripts/mod/file2alias.c
that checks that the size of the device ID type against the size of
the section in the object file succeeds (see comment and
http://lkml.org/lkml/2008/2/18/481 for explanation).

Signed-off-by: Gordon Farquharson <gordonfarquharson@gmail.com>

---

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 139d49d..208d49a 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -351,7 +351,13 @@ struct sdio_device_id {
 struct ssb_device_id {
 	__u16	vendor;
 	__u16	coreid;
-	__u8	revision;
+	/* Explicit padding to support a broken sanity check in file2alias.c.
+	 * The check compares the size of the structure in the kernel
+	 * object file to the size of the structure reported in userspace for
+	 * the system on which the kernel is compiled. The check breaks on
+	 * cross-compilation, and the padding is a workaround for this. */
+	__u8	revision
+		__attribute__((aligned(sizeof(__u32))));
 };
 #define SSB_DEVICE(_vendor, _coreid, _revision)  \
 	{ .vendor = _vendor, .coreid = _coreid, .revision = _revision, }

-- 
Gordon Farquharson
GnuPG Key ID: 32D6D676

  reply	other threads:[~2008-02-23 10:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18 22:03 Gordon Farquharson
2008-02-18 22:08 ` Michael Buesch
2008-02-18 22:13   ` Russell King
2008-02-18 22:24     ` Michael Buesch
2008-02-18 22:34       ` Russell King
2008-02-18 22:43         ` Michael Buesch
2008-02-18 22:50           ` Harvey Harrison
2008-02-18 22:56             ` Michael Buesch
2008-02-18 22:53           ` Russell King
2008-02-18 23:00             ` Russell King
2008-02-18 23:17               ` Michael Buesch
2008-02-18 23:42                 ` Sam Ravnborg
2008-02-19  0:01                   ` Michael Buesch
2008-02-19  4:59                     ` Gordon Farquharson
2008-02-19 10:41                       ` Michael Buesch
2008-02-20  0:44                         ` Gordon Farquharson
2008-02-20 14:44                           ` Michael Buesch
2008-02-20 19:37                             ` Sam Ravnborg
2008-02-22  4:24                               ` Gordon Farquharson
2008-02-22 12:08                                 ` Gordon Farquharson
2008-02-22 14:07                                 ` Michael Buesch
2008-02-23  4:34                                   ` Gordon Farquharson
2008-02-23  5:51                                     ` Michael Buesch
2008-02-23 10:14                                       ` Gordon Farquharson [this message]
2008-02-23 15:58                                         ` Michael Buesch
2008-02-26 14:37                               ` Ben Dooks
2008-02-26 16:12                                 ` Gordon Farquharson
2008-02-19  5:32                     ` Sam Ravnborg
2008-02-22 13:13                       ` Matthieu CASTET
2008-02-18 23:04             ` Michael Buesch
2008-02-19  8:37               ` Geert Uytterhoeven
2008-02-19 10:34                 ` Michael Buesch

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=97a0a9ac0802230214w6e6fe469q8e8a5597833aac33@mail.gmail.com \
    --to=gordonfarquharson@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=sam@ravnborg.org \
    --cc=stefano.brivio@polimi.it \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.linux.org.uk \
    --subject='Re: [RFC] [PATCH] Fix b43 driver build for arm' \
    /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

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).