Skip to content

Commit

Permalink
starfire: use BUILD_BUG_ON for netdrv_addr_t
Browse files Browse the repository at this point in the history
Detect size mismatch for netdrv_addr_t at build time rather than
checking at module load time.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Ion Badulescu <ionut@badula.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Akinobu Mita authored and David S. Miller committed Aug 28, 2010
1 parent d08336e commit 56543af
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/net/starfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,11 +2078,7 @@ static int __init starfire_init (void)
printk(KERN_INFO DRV_NAME ": polling (NAPI) enabled\n");
#endif

/* we can do this test only at run-time... sigh */
if (sizeof(dma_addr_t) != sizeof(netdrv_addr_t)) {
printk("This driver has dma_addr_t issues, please send email to maintainer\n");
return -ENODEV;
}
BUILD_BUG_ON(sizeof(dma_addr_t) != sizeof(netdrv_addr_t));

return pci_register_driver(&starfire_driver);
}
Expand Down

0 comments on commit 56543af

Please sign in to comment.