aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wavelan_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wavelan_cs.c')
-rw-r--r--drivers/net/wireless/wavelan_cs.c43
1 files changed, 9 insertions, 34 deletions
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 577c647824fe..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);
* (wavelan modem or i82593)
*/
-#ifdef STRUCT_CHECK
-/*------------------------------------------------------------------*/
-/*
- * Sanity routine to verify the sizes of the various WaveLAN interface
- * structures.
- */
-static char *
-wv_structuct_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");
-
-#undef SC
-
- return((char *) NULL);
-} /* wv_structuct_check */
-#endif /* STRUCT_CHECK */
-
/******************* MODEM MANAGEMENT SUBROUTINES *******************/
/*
* Useful subroutines to manage the modem of the wavelan
@@ -3223,14 +3202,14 @@ wv_mmc_init(struct net_device * dev)
* non-NCR/AT&T/Lucent PCMCIA cards, see wavelan_cs.h for detail on
* how to configure your card...
*/
- for(i = 0; i < (sizeof(MAC_ADDRESSES) / sizeof(char) / 3); i++)
- if((psa.psa_univ_mac_addr[0] == MAC_ADDRESSES[i][0]) &&
- (psa.psa_univ_mac_addr[1] == MAC_ADDRESSES[i][1]) &&
- (psa.psa_univ_mac_addr[2] == MAC_ADDRESSES[i][2]))
+ for (i = 0; i < ARRAY_SIZE(MAC_ADDRESSES); i++)
+ if ((psa.psa_univ_mac_addr[0] == MAC_ADDRESSES[i][0]) &&
+ (psa.psa_univ_mac_addr[1] == MAC_ADDRESSES[i][1]) &&
+ (psa.psa_univ_mac_addr[2] == MAC_ADDRESSES[i][2]))
break;
/* If we have not found it... */
- if(i == (sizeof(MAC_ADDRESSES) / sizeof(char) / 3))
+ if (i == ARRAY_SIZE(MAC_ADDRESSES))
{
#ifdef DEBUG_CONFIG_ERRORS
printk(KERN_WARNING "%s: wv_mmc_init(): Invalid MAC address: %02X:%02X:%02X:...\n",
@@ -3794,14 +3773,10 @@ wv_hw_config(struct net_device * dev)
printk(KERN_DEBUG "%s: ->wv_hw_config()\n", dev->name);
#endif
-#ifdef STRUCT_CHECK
- if(wv_structuct_check() != (char *) NULL)
- {
- printk(KERN_WARNING "%s: wv_hw_config: structure/compiler botch: \"%s\"\n",
- dev->name, wv_structuct_check());
- return FALSE;
- }
-#endif /* STRUCT_CHECK == 1 */
+ /* compile-time check the sizes of structures */
+ BUILD_BUG_ON(sizeof(psa_t) != PSA_SIZE);
+ BUILD_BUG_ON(sizeof(mmw_t) != MMW_SIZE);
+ BUILD_BUG_ON(sizeof(mmr_t) != MMR_SIZE);
/* Reset the pcmcia interface */
if(wv_pcmcia_reset(dev) == FALSE)