Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318181
b: refs/heads/master
c: 7012879
h: refs/heads/master
i:
  318179: e90bdb9
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent 83ae3d3 commit ab4a713
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 63 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fe9db37104f833972486355fe86d7dcd29279b5
refs/heads/master: 70128792b7802efcf485e9b62249cf8a639187d8
18 changes: 0 additions & 18 deletions trunk/drivers/staging/csr/csr_framework_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,6 @@ void *CsrMemCalloc(size_t numberOfElements, size_t elementSize)
return buf;
}

/*----------------------------------------------------------------------------*
* NAME
* CsrMemAlloc
*
* DESCRIPTION
* Allocate dynamic memory of a given size.
*
* RETURNS
* Pointer to allocated memory, or NULL in case of failure.
* Allocated memory is not initialised.
*
*----------------------------------------------------------------------------*/
void *CsrMemAlloc(size_t size)
{
return kmalloc(size, GFP_KERNEL);
}
EXPORT_SYMBOL_GPL(CsrMemAlloc);

/*----------------------------------------------------------------------------*
* NAME
* CsrMemAllocDma
Expand Down
22 changes: 0 additions & 22 deletions trunk/drivers/staging/csr/csr_framework_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,26 +242,6 @@ CsrResult CsrThreadEqual(CsrThreadHandle *threadHandle1, CsrThreadHandle *thread
void CsrThreadSleep(u16 sleepTimeInMs);

#ifndef CSR_PMEM_DEBUG_ENABLE
/*----------------------------------------------------------------------------*
* NAME
* CsrMemAlloc
*
* DESCRIPTION
* Allocate dynamic memory of a given size.
*
* RETURNS
* Pointer to allocated memory, or NULL in case of failure.
* Allocated memory is not initialised.
*
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemAllocDebug(size_t size,
const char *file, u32 line);
#define CsrMemAlloc(sz) CsrMemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrMemAlloc(size_t size);
#endif

/*----------------------------------------------------------------------------*
* NAME
* CsrMemCalloc
Expand Down Expand Up @@ -308,8 +288,6 @@ void *CsrMemAllocDma(size_t size);

#include "csr_pmem.h"

#define CsrMemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC, __FILE__, __LINE__)

#define CsrMemCalloc(numberOfElements, elementSize) CsrPmemDebugAlloc((numberOfElements * elementSize), CSR_PMEM_DEBUG_TYPE_MEM_CALLOC, __FILE__, __LINE__)

#define CsrMemAllocDma(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA, __FILE__, __LINE__)
Expand Down
13 changes: 4 additions & 9 deletions trunk/drivers/staging/csr/csr_wifi_hip_card_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ card_t* unifi_alloc_card(CsrSdioFunction *sdio, void *ospriv)
func_enter();


card = (card_t *)CsrMemAlloc(sizeof(card_t));
card = kzalloc(sizeof(card_t), GFP_KERNEL);
if (card == NULL)
{
return NULL;
}
memset(card, 0, sizeof(card_t));


card->sdio_if = sdio;
card->ospriv = ospriv;
Expand Down Expand Up @@ -1665,8 +1663,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
n = cfg_data->num_fromhost_data_slots;

unifi_trace(card->ospriv, UDBG3, "Alloc from-host resources, %d slots.\n", n);
card->from_host_data =
(slot_desc_t *)CsrMemAlloc(n * sizeof(slot_desc_t));
card->from_host_data = kmalloc(n * sizeof(slot_desc_t), GFP_KERNEL);
if (card->from_host_data == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for F-H bulk data array\n");
Expand All @@ -1681,8 +1678,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
}

/* Allocate memory for the array used for slot host tag mapping */
card->fh_slot_host_tag_record =
(u32 *)CsrMemAlloc(n * sizeof(u32));
card->fh_slot_host_tag_record = kmalloc(n * sizeof(u32), GFP_KERNEL);

if (card->fh_slot_host_tag_record == NULL)
{
Expand All @@ -1702,8 +1698,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
n = cfg_data->num_tohost_data_slots;

unifi_trace(card->ospriv, UDBG3, "Alloc to-host resources, %d slots.\n", n);
card->to_host_data =
(bulk_data_desc_t *)CsrMemAlloc(n * sizeof(bulk_data_desc_t));
card->to_host_data = kmalloc(n * sizeof(bulk_data_desc_t), GFP_KERNEL);
if (card->to_host_data == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for T-H bulk data array\n");
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/csr/csr_wifi_hip_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ CsrResult unifi_dl_firmware(card_t *card, void *dlpriv)

func_enter();

fwinfo = CsrMemAlloc(sizeof(xbv1_t));
fwinfo = kmalloc(sizeof(xbv1_t), GFP_KERNEL);
if (fwinfo == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for firmware\n");
Expand Down Expand Up @@ -409,7 +409,7 @@ CsrResult unifi_dl_patch(card_t *card, void *dlpriv, u32 boot_ctrl)

unifi_info(card->ospriv, "unifi_dl_patch %p %08x\n", dlpriv, boot_ctrl);

fwinfo = CsrMemAlloc(sizeof(xbv1_t));
fwinfo = kmalloc(sizeof(xbv1_t), GFP_KERNEL);
if (fwinfo == NULL)
{
unifi_error(card->ospriv, "Failed to allocate memory for patches\n");
Expand Down
11 changes: 3 additions & 8 deletions trunk/drivers/staging/csr/csr_wifi_hip_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,24 +667,19 @@ coredump_buffer* new_coredump_node(void *ospriv, coredump_buffer *prevnode)
u32 zone_size;

/* Allocate node header */
newnode = (coredump_buffer *)CsrMemAlloc(sizeof(coredump_buffer));
newnode = kzalloc(sizeof(coredump_buffer), GFP_KERNEL);
if (newnode == NULL)
{
return NULL;
}
memset(newnode, 0, sizeof(coredump_buffer));

/* Allocate chip memory zone capture buffers */
for (i = 0; i < HIP_CDUMP_NUM_ZONES; i++)
{
zone_size = sizeof(u16) * zonedef_table[i].length;
newzone = (u16 *)CsrMemAlloc(zone_size);
newzone = kzalloc(zone_size, GFP_KERNEL);
newnode->zone[i] = newzone;
if (newzone != NULL)
{
memset(newzone, 0, zone_size);
}
else
if (newzone == NULL)
{
unifi_error(ospriv, "Out of memory on coredump zone %d (%d words)\n",
i, zonedef_table[i].length);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/csr/csr_wifi_hip_xbv.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ void* xbv_to_patch(card_t *card, fwreadfn_t readfn,
}

/* Pre-allocate read buffer for chunk conversion */
rdbuf = CsrMemAlloc(PTDL_MAX_SIZE);
rdbuf = kmalloc(PTDL_MAX_SIZE, GFP_KERNEL);
if (!rdbuf)
{
unifi_error(card, "Couldn't alloc conversion buffer\n");
Expand All @@ -1019,7 +1019,7 @@ void* xbv_to_patch(card_t *card, fwreadfn_t readfn,
*/
patch_buf_size = calc_patch_size(fwinfo);

patch_buf = (void *)CsrMemAlloc(patch_buf_size);
patch_buf = kmalloc(patch_buf_size, GFP_KERNEL);
if (!patch_buf)
{
kfree(rdbuf);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/csr/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static CsrResult signal_buffer_init(unifi_priv_t * priv, int size)
for(i=0; i<size; i++)
{
priv->rxSignalBuffer.rx_buff[i].sig_len=0;
priv->rxSignalBuffer.rx_buff[i].bufptr = CsrMemAlloc(UNIFI_PACKED_SIGBUF_SIZE);
priv->rxSignalBuffer.rx_buff[i].bufptr = kmalloc(UNIFI_PACKED_SIGBUF_SIZE, GFP_KERNEL);
if (priv->rxSignalBuffer.rx_buff[i].bufptr == NULL)
{
int j;
Expand Down

0 comments on commit ab4a713

Please sign in to comment.