* [PATCH] b43: Add slot count compiletime assertion
@ 2009-02-19 23:09 Michael Buesch
2009-02-20 10:32 ` Michael Buesch
0 siblings, 1 reply; 2+ messages in thread
From: Michael Buesch @ 2009-02-19 23:09 UTC (permalink / raw)
To: John W Linville; +Cc: bcm43xx-dev, linux-wireless
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>
---
Please queue on top of the DMA optimizations.
Index: wireless-testing/drivers/net/wireless/b43/dma.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/dma.c 2009-02-19 23:34:25.000000000 +0100
+++ wireless-testing/drivers/net/wireless/b43/dma.c 2009-02-20 00:03:30.000000000 +0100
@@ -839,12 +839,16 @@ struct b43_dmaring *b43_setup_dmaring(st
spin_lock_init(&ring->lock);
#ifdef CONFIG_B43_DEBUG
ring->last_injected_overflow = jiffies;
#endif
if (for_tx) {
+ /* Assumption: B43_TXRING_SLOTS can be divided by TX_SLOTS_PER_FRAME */
+ BUILD_BUG_ON((B43_TXRING_SLOTS * 1000000) / TX_SLOTS_PER_FRAME !=
+ (B43_TXRING_SLOTS / TX_SLOTS_PER_FRAME) * 1000000);
+
ring->txhdr_cache = kcalloc(ring->nr_slots / TX_SLOTS_PER_FRAME,
b43_txhdr_size(dev),
GFP_KERNEL);
if (!ring->txhdr_cache)
goto err_kfree_meta;
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] b43: Add slot count compiletime assertion
2009-02-19 23:09 [PATCH] b43: Add slot count compiletime assertion Michael Buesch
@ 2009-02-20 10:32 ` Michael Buesch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2009-02-20 10:32 UTC (permalink / raw)
To: bcm43xx-dev; +Cc: John W Linville, linux-wireless
On Friday 20 February 2009 00:09:42 Michael Buesch wrote:
> 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>
>
> ---
>
> Please queue on top of the DMA optimizations.
I wonder what I was smoking when doing this patch, yesterday.
I'll immediately get a brown paper bag and redo a sane version of this... :)
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-20 10:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 23:09 [PATCH] b43: Add slot count compiletime assertion Michael Buesch
2009-02-20 10:32 ` Michael Buesch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).