aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wavelan_cs.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2008-01-13 09:16:34 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:50 -0500
commit60da481b98082ff5ffd233b18683c3ffe3ab618c (patch)
tree3660cdeef28b88f3fc6997b299ac5a3158654b20 /drivers/net/wireless/wavelan_cs.c
parenteb189d8bc9824bcb2187ffdab27d77ab469264c3 (diff)
WAVELAN - compile-time check for struct sizes
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wavelan_cs.c')
-rw-r--r--drivers/net/wireless/wavelan_cs.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index da1d4e8f0f6b..c2037b2a05bf 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -71,27 +71,6 @@ static void wv_nwid_filter(unsigned char mode, net_local *lp);
71 * (wavelan modem or i82593) 71 * (wavelan modem or i82593)
72 */ 72 */
73 73
74#ifdef STRUCT_CHECK
75/*------------------------------------------------------------------*/
76/*
77 * Sanity routine to verify the sizes of the various WaveLAN interface
78 * structures.
79 */
80static char *
81wv_structuct_check(void)
82{
83#define SC(t,s,n) if (sizeof(t) != s) return(n);
84
85 SC(psa_t, PSA_SIZE, "psa_t");
86 SC(mmw_t, MMW_SIZE, "mmw_t");
87 SC(mmr_t, MMR_SIZE, "mmr_t");
88
89#undef SC
90
91 return((char *) NULL);
92} /* wv_structuct_check */
93#endif /* STRUCT_CHECK */
94
95/******************* MODEM MANAGEMENT SUBROUTINES *******************/ 74/******************* MODEM MANAGEMENT SUBROUTINES *******************/
96/* 75/*
97 * Useful subroutines to manage the modem of the wavelan 76 * Useful subroutines to manage the modem of the wavelan
@@ -3794,14 +3773,10 @@ wv_hw_config(struct net_device * dev)
3794 printk(KERN_DEBUG "%s: ->wv_hw_config()\n", dev->name); 3773 printk(KERN_DEBUG "%s: ->wv_hw_config()\n", dev->name);
3795#endif 3774#endif
3796 3775
3797#ifdef STRUCT_CHECK 3776 /* compile-time check the sizes of structures */
3798 if(wv_structuct_check() != (char *) NULL) 3777 BUILD_BUG_ON(sizeof(psa_t) != PSA_SIZE);
3799 { 3778 BUILD_BUG_ON(sizeof(mmw_t) != MMW_SIZE);
3800 printk(KERN_WARNING "%s: wv_hw_config: structure/compiler botch: \"%s\"\n", 3779 BUILD_BUG_ON(sizeof(mmr_t) != MMR_SIZE);
3801 dev->name, wv_structuct_check());
3802 return FALSE;
3803 }
3804#endif /* STRUCT_CHECK == 1 */
3805 3780
3806 /* Reset the pcmcia interface */ 3781 /* Reset the pcmcia interface */
3807 if(wv_pcmcia_reset(dev) == FALSE) 3782 if(wv_pcmcia_reset(dev) == FALSE)