From: Michael Buesch Date: Fri, 20 Feb 2009 11:24:52 +0000 (+0100) Subject: b43: Add slot count compiletime assertion X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2d071ca50e9f20bf0203a7e8dbb1c784934e324d;p=linux-beck.git b43: Add slot count compiletime assertion This adds a compiletime assertion for a recently introduced assumption on the slot counts. The tx header cache handling code assumes that the TX slot count can be divided evenly by the number of TX slots per frame. Signed-off-by: Michael Buesch Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c index 189b2ec1bac7..c69b70e0a721 100644 --- a/drivers/net/wireless/b43/dma.c +++ b/drivers/net/wireless/b43/dma.c @@ -842,6 +842,9 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev, #endif if (for_tx) { + /* Assumption: B43_TXRING_SLOTS can be divided by TX_SLOTS_PER_FRAME */ + BUILD_BUG_ON(B43_TXRING_SLOTS % TX_SLOTS_PER_FRAME != 0); + ring->txhdr_cache = kcalloc(ring->nr_slots / TX_SLOTS_PER_FRAME, b43_txhdr_size(dev), GFP_KERNEL);