Skip to content

Commit

Permalink
b43: Add slot count compiletime assertion
Browse files Browse the repository at this point in the history
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 <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Michael Buesch authored and John W. Linville committed Feb 27, 2009
1 parent 20977d3 commit 2d071ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2d071ca

Please sign in to comment.