From 4becf12de1a4efefd28e057750e35f4ceb32dd1d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 20 Jul 2012 15:47:35 -0700 Subject: [PATCH] staging: csr: remove CsrMemAllocDma() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It's just a call to kmalloc(, GFP_KERNEL | GFP_DMA); But, all memory allocated by kmalloc can be DMAed, and that's not what GFP_DMA means, so remove that flag, and just call kmalloc(, GFP_KERNEL); Cc: Mikko Virkkilä Cc: Lauri Hintsala Cc: Riku Mettälä Cc: Veli-Pekka Peltola Signed-off-by: Greg Kroah-Hartman --- drivers/staging/csr/csr_framework_ext.c | 18 ------------- drivers/staging/csr/csr_framework_ext.h | 31 ----------------------- drivers/staging/csr/csr_wifi_hip_card_sdio.c | 4 +-- drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c | 2 +- drivers/staging/csr/csr_wifi_hip_download.c | 2 +- 5 files changed, 4 insertions(+), 53 deletions(-) diff --git a/drivers/staging/csr/csr_framework_ext.c b/drivers/staging/csr/csr_framework_ext.c index 771a369..12e7ddf 100644 --- a/drivers/staging/csr/csr_framework_ext.c +++ b/drivers/staging/csr/csr_framework_ext.c @@ -146,21 +146,3 @@ void CsrThreadSleep(u16 sleepTimeInMs) schedule_timeout_uninterruptible(t); } EXPORT_SYMBOL_GPL(CsrThreadSleep); - -/*----------------------------------------------------------------------------* - * NAME - * CsrMemAllocDma - * - * DESCRIPTION - * Allocate DMA capable dynamic memory of a given size. - * - * RETURNS - * Pointer to allocated memory, or NULL in case of failure. - * Allocated memory is not initialised. - * - *----------------------------------------------------------------------------*/ -void *CsrMemAllocDma(size_t size) -{ - return kmalloc(size, GFP_KERNEL | GFP_DMA); -} -EXPORT_SYMBOL_GPL(CsrMemAllocDma); diff --git a/drivers/staging/csr/csr_framework_ext.h b/drivers/staging/csr/csr_framework_ext.h index 817369d..66973e9 100644 --- a/drivers/staging/csr/csr_framework_ext.h +++ b/drivers/staging/csr/csr_framework_ext.h @@ -241,37 +241,6 @@ CsrResult CsrThreadEqual(CsrThreadHandle *threadHandle1, CsrThreadHandle *thread *----------------------------------------------------------------------------*/ void CsrThreadSleep(u16 sleepTimeInMs); -#ifndef CSR_PMEM_DEBUG_ENABLE -/*----------------------------------------------------------------------------* - * NAME - * CsrMemAllocDma - * - * DESCRIPTION - * Allocate dynamic memory suitable for DMA transfers. - * - * RETURNS - * Pointer to allocated memory, or NULL in case of failure. - * Allocated memory is not initialised. - * - *----------------------------------------------------------------------------*/ -#ifdef CSR_MEM_DEBUG -void *CsrMemAllocDmaDebug(size_t size, - const char *file, u32 line); -#define CsrMemAllocDma(sz) CsrMemAllocDmaDebug((sz), __FILE__, __LINE__) -#else -void *CsrMemAllocDma(size_t size); -#endif - - -#else - -#include "csr_pmem.h" - -#define CsrMemAllocDma(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA, __FILE__, __LINE__) - -#endif - - #ifdef __cplusplus } #endif diff --git a/drivers/staging/csr/csr_wifi_hip_card_sdio.c b/drivers/staging/csr/csr_wifi_hip_card_sdio.c index 608a069..d4c9281 100644 --- a/drivers/staging/csr/csr_wifi_hip_card_sdio.c +++ b/drivers/staging/csr/csr_wifi_hip_card_sdio.c @@ -1630,7 +1630,7 @@ static CsrResult card_allocate_memory_resources(card_t *card) /* * Allocate memory for the from-host and to-host signal buffers. */ - card->fh_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE); + card->fh_buffer.buf = kmalloc(UNIFI_FH_BUF_SIZE, GFP_KERNEL); if (card->fh_buffer.buf == NULL) { unifi_error(card->ospriv, "Failed to allocate memory for F-H signals\n"); @@ -1641,7 +1641,7 @@ static CsrResult card_allocate_memory_resources(card_t *card) card->fh_buffer.ptr = card->fh_buffer.buf; card->fh_buffer.count = 0; - card->th_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE); + card->th_buffer.buf = kmalloc(UNIFI_FH_BUF_SIZE, GFP_KERNEL); if (card->th_buffer.buf == NULL) { unifi_error(card->ospriv, "Failed to allocate memory for T-H signals\n"); diff --git a/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c b/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c index 9789579..97f645c 100644 --- a/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c +++ b/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c @@ -1758,7 +1758,7 @@ static CsrResult process_bulk_data_command(card_t *card, const u8 *cmdptr, if (len != 0 && (dir == UNIFI_SDIO_WRITE) && (((ptrdiff_t)bdslot->os_data_ptr + offset) & 3)) { - host_bulk_data_slot = CsrMemAllocDma(len); + host_bulk_data_slot = kmalloc(len, GFP_KERNEL); if (!host_bulk_data_slot) { diff --git a/drivers/staging/csr/csr_wifi_hip_download.c b/drivers/staging/csr/csr_wifi_hip_download.c index f0f0ffd..8e4a460 100644 --- a/drivers/staging/csr/csr_wifi_hip_download.c +++ b/drivers/staging/csr/csr_wifi_hip_download.c @@ -675,7 +675,7 @@ static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv, return CSR_WIFI_HIP_RESULT_INVALID_VALUE; } - buf = CsrMemAllocDma(buf_size); + buf = kmalloc(buf_size, GFP_KERNEL); if (buf == NULL) { unifi_error(card->ospriv, "Failed to allocate transfer buffer for firmware download\n"); -- 2.7.4