All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jean Tourrilhes <jt@hpl.hp.com>,
	linux-wireless@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] WAVELAN - compile-time check for struct sizes
Date: Wed, 6 Feb 2008 21:50:23 +0100	[thread overview]
Message-ID: <200802062150.23930.deller@gmx.de> (raw)
In-Reply-To: <20080202224515.20a09553.akpm@linux-foundation.org>

On Sunday 03 February 2008, Andrew Morton wrote:
> On Sun, 13 Jan 2008 15:16:34 +0100 Helge Deller <deller@gmx.de> wrote:
> 
> > Convert optional struct size checks to non-optional compile-time checks.
> > Furthermore BUILD_BUG_ON() which will be optimized away by the compiler.
> > 
> > Signed-off-by: Helge Deller <deller@gmx.de>
> > 
> >  wavelan.c      |   34 +++++-----------------------------
> >  wavelan.p.h    |    1 -
> >  wavelan_cs.c   |   33 ++++-----------------------------
> >  wavelan_cs.p.h |    1 -
> >  4 files changed, 9 insertions(+), 60 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
> > index a1f8a16..ffe50e2 100644
> > --- a/drivers/net/wireless/wavelan.c
> > +++ b/drivers/net/wireless/wavelan.c
> > @@ -49,27 +49,6 @@ static int __init wv_psa_to_irq(u8 irqval)
> >  	return -1;
> >  }
> >  
> > -#ifdef STRUCT_CHECK
> > -/*------------------------------------------------------------------*/
> > -/*
> > - * Sanity routine to verify the sizes of the various WaveLAN interface
> > - * structures.
> > - */
> > -static char *wv_struct_check(void)
> > -{
> > -#define	SC(t,s,n)	if (sizeof(t) != s) return(n);
> > -
> > -	SC(psa_t, PSA_SIZE, "psa_t");
> > -	SC(mmw_t, MMW_SIZE, "mmw_t");
> > -	SC(mmr_t, MMR_SIZE, "mmr_t");
> > -	SC(ha_t, HA_SIZE, "ha_t");
> > -
> > -#undef	SC
> > -
> > -	return ((char *) NULL);
> > -}				/* wv_struct_check */
> > -#endif				/* STRUCT_CHECK */
> > -
> >  /********************* HOST ADAPTER SUBROUTINES *********************/
> >  /*
> >   * Useful subroutines to manage the WaveLAN ISA interface
> > @@ -4215,14 +4194,11 @@ struct net_device * __init wavelan_probe(int unit)
> >  	int i;
> >  	int r = 0;
> >  
> > -#ifdef	STRUCT_CHECK
> > -	if (wv_struct_check() != (char *) NULL) {
> > -		printk(KERN_WARNING
> > -		       "%s: wavelan_probe(): structure/compiler botch: \"%s\"\n",
> > -		       dev->name, wv_struct_check());
> > -		return -ENODEV;
> > -	}
> > -#endif				/* STRUCT_CHECK */
> > +	/* compile-time check the sizes of structures */
> > +	BUILD_BUG_ON(sizeof(psa_t) != PSA_SIZE);
> > +	BUILD_BUG_ON(sizeof(mmw_t) != MMW_SIZE);
> 
> This assertion is now triggering with arm allmodconfig.
> 
> Rafael, please track this as a post-2.6.24 regression.

Hello Andrew,

with which arm platform did you found this assertion to trigger ?
I tried a few (e.g. ARM-poodle and CONFIG_ARCH_SA1100 w/ISA) but didn't saw it breaking.
Maybe you could send me you .config file ?

Helge

PS: I tried Linus' current git tree which now includes my patch above as well.

  reply	other threads:[~2008-02-06 20:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13 14:16 [PATCH] WAVELAN - compile-time check for struct sizes Helge Deller
2008-02-03  6:45 ` Andrew Morton
2008-02-06 20:50   ` Helge Deller [this message]
2008-02-06 21:04     ` Andrew Morton
2008-02-06 21:47       ` Russell King - ARM Linux
2008-02-06 21:59         ` Andrew Morton
2008-02-07 15:51           ` John W. Linville
2008-02-07 16:06             ` Russell King - ARM Linux
2008-02-07 18:49             ` Andrew Morton
2008-02-07 19:08               ` John W. Linville
2008-02-07 19:50                 ` Russell King - ARM Linux
2008-02-07 20:02                 ` Andrew Morton
2008-02-07 20:46                   ` John W. Linville
2008-02-07 21:27                     ` Andrew Morton
2008-02-13 12:17                     ` Rafael J. Wysocki

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=200802062150.23930.deller@gmx.de \
    --to=deller@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=jt@hpl.hp.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.