lkml.org 
[lkml]   [2014]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/1] drivers/net/wireless/brcm80211/brcmsmac/dma.c: replace shift loop by ilog2
Don't open code ilog2 -> remove dma_align_sizetobits

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/net/wireless/brcm80211/brcmsmac/dma.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
index 4fb9635..7128c78 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
@@ -451,15 +451,6 @@ static void *dma_alloc_consistent(struct dma_info *di, uint size,
return dma_alloc_coherent(di->dmadev, size, pap, GFP_ATOMIC);
}

-static
-u8 dma_align_sizetobits(uint size)
-{
- u8 bitpos = 0;
- while (size >>= 1)
- bitpos++;
- return bitpos;
-}
-
/* This function ensures that the DMA descriptor ring will not get allocated
* across Page boundary. If the allocation is done across the page boundary
* at the first time, then it is freed and the allocation is done at
@@ -482,7 +473,7 @@ static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,
desc_strtaddr = (u32) roundup((unsigned long)va, alignbytes);
if (((desc_strtaddr + size - 1) & boundary) != (desc_strtaddr
& boundary)) {
- *alignbits = dma_align_sizetobits(size);
+ *alignbits = ilog2(size);
dma_free_coherent(di->dmadev, size, va, *descpa);
va = dma_alloc_consistent(di, size, *alignbits,
alloced, descpa);
--
1.8.4.5


\
 
 \ /
  Last update: 2014-05-21 17:41    [W:1.260 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site