Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318185
b: refs/heads/master
c: 786eeeb
h: refs/heads/master
i:
  318183: 9132f87
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent 897041a commit e4b75f7
Show file tree
Hide file tree
Showing 27 changed files with 535 additions and 606 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: 55a27055b9ea5aabf8206ed6b7777c79f4e840c3
refs/heads/master: 786eeeb3756e7fb08174c3a136c16462ccd541d1
1 change: 0 additions & 1 deletion trunk/drivers/staging/csr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ csr_wifi-y := bh.o \
csr_helper-y := csr_time.o \
csr_util.o \
csr_framework_ext.o \
csr_pmem.o \
csr_wifi_serialize_primitive_types.o \
csr_serialize_primitive_types.o \
csr_utf16.o \
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/csr/csr_msgconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void CsrMsgConvInsert(u16 primType, const CsrMsgConvMsgEntry *ce)
}
else
{
pc = CsrPmemAlloc(sizeof(*pc));
pc = kmalloc(sizeof(*pc), GFP_KERNEL);
pc->primType = primType;
pc->conv = ce;
pc->lookupFunc = NULL;
Expand Down Expand Up @@ -279,7 +279,7 @@ CsrMsgConvEntry *CsrMsgConvInit(void)
{
if (!converter)
{
converter = (CsrMsgConvEntry *) CsrPmemAlloc(sizeof(CsrMsgConvEntry));
converter = kmalloc(sizeof(CsrMsgConvEntry), GFP_KERNEL);

converter->profile_converters = NULL;
converter->free_message = free_message;
Expand Down
40 changes: 0 additions & 40 deletions trunk/drivers/staging/csr/csr_pmem.c

This file was deleted.

31 changes: 0 additions & 31 deletions trunk/drivers/staging/csr/csr_pmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,6 @@
extern "C" {
#endif

#ifndef CSR_PMEM_DEBUG_ENABLE
/*****************************************************************************
NAME
CsrPmemAlloc
DESCRIPTION
This function will allocate a contiguous block of memory of at least
the specified size in bytes and return a pointer to the allocated
memory. This function is not allowed to return NULL. A size of 0 is a
valid request, and a unique and valid (not NULL) pointer must be
returned in this case.
PARAMETERS
size - Size of memory requested. Note that a size of 0 is valid.
RETURNS
Pointer to allocated memory.
*****************************************************************************/
#ifdef CSR_PMEM_DEBUG
void *CsrPmemAllocDebug(size_t size,
const char *file, u32 line);
#define CsrPmemAlloc(sz) CsrPmemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrPmemAlloc(size_t size);
#endif

#endif

/*****************************************************************************
NAME
Expand Down Expand Up @@ -114,7 +84,6 @@ typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocTyp
void CsrPmemDebugInstallHooks(u8 headSize, u8 endSize, CsrPmemDebugOnAlloc *onAllocCallback, CsrPmemDebugOnFree *onFreeCallback);

void *CsrPmemDebugAlloc(size_t size, CsrPmemDebugAllocType type, const char* file, u32 line);
#define CsrPmemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const char* file, u32 line);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/csr/csr_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ void CsrSchedBgintSet(CsrSchedBgint bgint);
* be null.
*
* NOTE
* If "mv" is not null then it will typically be a chunk of CsrPmemAlloc()ed
* If "mv" is not null then it will typically be a chunk of kmalloc()ed
* memory, though there is no need for it to be so. Tasks should normally
* obey the convention that when a message built with CsrPmemAlloc()ed memory
* obey the convention that when a message built with kmalloc()ed memory
* is given to CsrSchedMessagePut() then ownership of the memory is ceded to the
* scheduler - and eventually to the recipient task. I.e., the receiver of
* the message will be expected to kfree() the message storage.
Expand Down
23 changes: 12 additions & 11 deletions trunk/drivers/staging/csr/csr_serialize_primitive_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*****************************************************************************/

#include <linux/module.h>
#include <linux/slab.h>
#include "csr_prim_defs.h"
#include "csr_msgconv.h"
#include "csr_macro.h"
Expand Down Expand Up @@ -66,7 +67,7 @@ void CsrUtf16StringDes(u16 **value, u8 *buffer, size_t *offset)

CsrUint32Des(&length, buffer, offset);

*value = CsrPmemAlloc(length * sizeof(**value));
*value = kmalloc(length * sizeof(**value), GFP_KERNEL);
for (i = 0; i < length; i++)
{
CsrUint16Des(&(*value)[i], buffer, offset);
Expand Down Expand Up @@ -224,7 +225,7 @@ u8 *CsrEventSer(u8 *ptr, size_t *len, void *msg)

void *CsrEventDes(u8 *buffer, size_t length)
{
CsrEvent *primitive = (CsrEvent *) CsrPmemAlloc(sizeof(CsrEvent));
CsrEvent *primitive = kmalloc(sizeof(CsrEvent), GFP_KERNEL);
size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);

Expand All @@ -247,7 +248,7 @@ u8 *CsrEventCsrUint8Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint8Des(u8 *buffer, size_t length)
{
CsrEventCsrUint8 *primitive = (CsrEventCsrUint8 *) CsrPmemAlloc(sizeof(CsrEventCsrUint8));
CsrEventCsrUint8 *primitive = kmalloc(sizeof(CsrEventCsrUint8), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -272,7 +273,7 @@ u8 *CsrEventCsrUint16Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint16Des(u8 *buffer, size_t length)
{
CsrEventCsrUint16 *primitive = (CsrEventCsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16));
CsrEventCsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint16), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -297,7 +298,7 @@ u8 *CsrEventCsrUint32Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint32Des(u8 *buffer, size_t length)
{
CsrEventCsrUint32 *primitive = (CsrEventCsrUint32 *) CsrPmemAlloc(sizeof(CsrEventCsrUint32));
CsrEventCsrUint32 *primitive = kmalloc(sizeof(CsrEventCsrUint32), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -323,7 +324,7 @@ u8 *CsrEventCsrUint16CsrUint8Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint16CsrUint8Des(u8 *buffer, size_t length)
{
CsrEventCsrUint16CsrUint8 *primitive = (CsrEventCsrUint16CsrUint8 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint8));
CsrEventCsrUint16CsrUint8 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint8), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -350,7 +351,7 @@ u8 *CsrEventCsrUint16CsrUint16Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint16CsrUint16Des(u8 *buffer, size_t length)
{
CsrEventCsrUint16CsrUint16 *primitive = (CsrEventCsrUint16CsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint16));
CsrEventCsrUint16CsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint16), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -377,7 +378,7 @@ u8 *CsrEventCsrUint16CsrUint32Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint16CsrUint32Des(u8 *buffer, size_t length)
{
CsrEventCsrUint16CsrUint32 *primitive = (CsrEventCsrUint16CsrUint32 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint32));
CsrEventCsrUint16CsrUint32 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint32), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand Down Expand Up @@ -405,7 +406,7 @@ u8 *CsrEventCsrUint16CsrCharStringSer(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint16CsrCharStringDes(u8 *buffer, size_t length)
{
CsrEventCsrUint16CsrCharString *primitive = (CsrEventCsrUint16CsrCharString *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrCharString));
CsrEventCsrUint16CsrCharString *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrCharString), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand All @@ -432,7 +433,7 @@ u8 *CsrEventCsrUint32CsrUint16Ser(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint32CsrUint16Des(u8 *buffer, size_t length)
{
CsrEventCsrUint32CsrUint16 *primitive = (CsrEventCsrUint32CsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint32CsrUint16));
CsrEventCsrUint32CsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint32CsrUint16), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand Down Expand Up @@ -460,7 +461,7 @@ u8 *CsrEventCsrUint32CsrCharStringSer(u8 *ptr, size_t *len, void *msg)

void *CsrEventCsrUint32CsrCharStringDes(u8 *buffer, size_t length)
{
CsrEventCsrUint32CsrCharString *primitive = (CsrEventCsrUint32CsrCharString *) CsrPmemAlloc(sizeof(CsrEventCsrUint32CsrCharString));
CsrEventCsrUint32CsrCharString *primitive = kmalloc(sizeof(CsrEventCsrUint32CsrCharString), GFP_KERNEL);

size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset);
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/staging/csr/csr_utf16.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ u16 *CsrUint32ToUtf16String(u32 number)
noOfDigits++;
}

output = (u16 *) CsrPmemAlloc(sizeof(u16) * (noOfDigits + 1)); /*add space for 0-termination*/
output = kmalloc(sizeof(u16) * (noOfDigits + 1), GFP_KERNEL); /*add space for 0-termination*/

tempNumber = number;
for (count = noOfDigits; count > 0; count--)
Expand Down Expand Up @@ -185,7 +185,7 @@ u16 *CsrUtf16ConcatenateTexts(const u16 *inputText1, const u16 *inputText2,
return NULL;
}

outputText = (u16 *) CsrPmemAlloc((textLen + 1) * sizeof(u16)); /* add space for 0-termination*/
outputText = kmalloc((textLen + 1) * sizeof(u16), GFP_KERNEL); /* add space for 0-termination*/


if (inputText1 != NULL)
Expand Down Expand Up @@ -320,7 +320,7 @@ u8 *CsrUtf16String2Utf8(const u16 *source)
}
}

dest = CsrPmemAlloc(length);
dest = kmalloc(length, GFP_KERNEL);
destStart = dest;

for (i = 0; i < sourceLength; i++)
Expand Down Expand Up @@ -610,7 +610,7 @@ u16 *CsrUtf82Utf16String(const u8 *utf8String)
}

/* Create space for the null terminated character */
dest = (u16 *) CsrPmemAlloc((1 + length) * sizeof(u16));
dest = kmalloc((1 + length) * sizeof(u16), GFP_KERNEL);
destStart = dest;

for (i = 0; i < sourceLength; i++)
Expand Down Expand Up @@ -736,7 +736,7 @@ u16 *CsrUtf16StringDuplicate(const u16 *source)
if (source) /* if source is not NULL*/
{
length = (CsrUtf16StrLen(source) + 1) * sizeof(u16);
target = (u16 *) CsrPmemAlloc(length);
target = kmalloc(length, GFP_KERNEL);
memcpy(target, source, length);
}
return target;
Expand Down Expand Up @@ -844,7 +844,7 @@ u16 *CsrUtf16String2XML(u16 *str)

if (encodeChars)
{
resultString = outputString = CsrPmemAlloc(stringLength * sizeof(u16));
resultString = outputString = kmalloc(stringLength * sizeof(u16), GFP_KERNEL);

scanString = str;

Expand Down Expand Up @@ -958,7 +958,7 @@ u16 *CsrXML2Utf16String(u16 *str)

if (encodeChars)
{
resultString = outputString = CsrPmemAlloc(stringLength * sizeof(u16));
resultString = outputString = kmalloc(stringLength * sizeof(u16), GFP_KERNEL);

scanString = str;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/csr/csr_wifi_fsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ extern void CsrWifiFsmSendEventExternal(CsrWifiFsmContext *context, CsrWifiFsmEv
*/
#define CsrWifiFsmSendAlienEventExternal(_context, _alienEvent, _source, _destination, _primtype, _id) \
{ \
CsrWifiFsmAlienEvent *_evt = (CsrWifiFsmAlienEvent *)CsrPmemAlloc(sizeof(CsrWifiFsmAlienEvent)); \
CsrWifiFsmAlienEvent *_evt = kmalloc(sizeof(CsrWifiFsmAlienEvent), GFP_KERNEL); \
_evt->alienEvent = _alienEvent; \
CsrWifiFsmSendEventExternal(_context, (CsrWifiFsmEvent *)_evt, _source, _destination, _primtype, _id); \
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/csr/csr_wifi_hip_card_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)

/*
* Allocate memory for the from-host and to-host bulk data slots.
* This is done as separate CsrPmemAllocs because lots of smaller
* This is done as separate kmallocs because lots of smaller
* allocations are more likely to succeed than one huge one.
*/

Expand Down
Loading

0 comments on commit e4b75f7

Please sign in to comment.