LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Michael Buesch <mb@bu3sch.de>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>,
	Gordon Farquharson <gordonfarquharson@gmail.com>,
	linux-kernel@vger.kernel.org, linville@tuxdriver.com,
	stefano.brivio@polimi.it
Subject: Re: [RFC] [PATCH] Fix b43 driver build for arm
Date: Tue, 19 Feb 2008 00:42:12 +0100	[thread overview]
Message-ID: <20080218234212.GA25680@uranus.ravnborg.org> (raw)
In-Reply-To: <200802190017.04432.mb@bu3sch.de>

On Tue, Feb 19, 2008 at 12:17:04AM +0100, Michael Buesch wrote:
> On Tuesday 19 February 2008 00:00:58 Russell King wrote:
> > > > Why can't we have an array of this structure on ARM?
> > > > 
> > > > struct ssb_device_id {
> > > >        __u16   vendor;
> > > 
> > > 2 bytes
> > > 
> > > >        __u16   coreid;
> > > 
> > > 2 bytes
> > > 
> > > >        __u8    revision;
> > > 
> > > 1 byte
> > > 
> > > > };
> > > 
> > > and therefore sizeof this structure will be 5 bytes, but because of the
> > > ABI rules (which are _explicitly_ allowed by the C standard), it'll
> > > become 8 bytes due to padding afterwards.
> > 
> > Another guess might be that, if using AEABI, this structure might
> > be 6 bytes in size, but the linker will align structures to 4 bytes.
> 
> If the struct is padded to 6 bytes and the linker aligns it to 4 byte
> everything will be naturally aligned, as far as I can see.
> 
> > FATAL: drivers/net/wireless/b43/b43: sizeof(struct ssb_device_id)=6 is
> > not a modulo of the size of section __mod_ssb_device_table=64.
> > Fix definition of struct ssb_device_id in mod_devicetable.h
> 
> So this message tells me the table size is 64 bytes. There are 8 entries,
> so it seems the structure is padded to 8 bytes.
> But above that it says that sizeof(struct ssb_device_id)=6
> 
> IMO this sanity check is broken and not the code.
> 
> Where does this sanity check message come from? The linker?
$ git grep 'not a modulo'
scripts/mod/file2alias.c:               fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "

It is a consistencycheck between host and target
layout of data.
You need to pad the structure so it becomes 8 byte in size.

	Sam

  reply	other threads:[~2008-02-18 23:42 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 [this message]
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
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=20080218234212.GA25680@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=gordonfarquharson@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=stefano.brivio@polimi.it \
    --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).