Skip to content

Commit

Permalink
staging: csr: remove CsrPmemFree()
Browse files Browse the repository at this point in the history
It's just a wrapper around kfree() so call that instead.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent 4becf12 commit 55a2705
Show file tree
Hide file tree
Showing 23 changed files with 282 additions and 303 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/csr/csr_msgconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <linux/module.h>
#include <linux/types.h>
#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_panic.h"
#include "csr_sched.h"
Expand Down Expand Up @@ -312,11 +313,11 @@ void CsrMsgConvDeinit(void)
{
CsrMsgConvPrimEntry *s_next;
s_next = s->next;
CsrPmemFree(s);
kfree(s);
s = s_next;
}

CsrPmemFree(converter);
kfree(converter);
converter = NULL;
}
EXPORT_SYMBOL_GPL(CsrMsgConvDeinit);
Expand Down
11 changes: 0 additions & 11 deletions drivers/staging/csr/csr_pmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,3 @@ void *CsrPmemAlloc(size_t size)
return ret;
}
EXPORT_SYMBOL_GPL(CsrPmemAlloc);

void CsrPmemFree(void *ptr)
{
if (ptr == NULL)
{
return;
}

kfree(ptr);
}
EXPORT_SYMBOL_GPL(CsrPmemFree);
15 changes: 0 additions & 15 deletions drivers/staging/csr/csr_pmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,6 @@ void *CsrPmemAllocDebug(size_t size,
void *CsrPmemAlloc(size_t size);
#endif


/*****************************************************************************
NAME
CsrPmemFree
DESCRIPTION
This function will deallocate a previously allocated block of memory.
PARAMETERS
ptr - Pointer to allocated memory.
*****************************************************************************/
void CsrPmemFree(void *ptr);
#endif

/*****************************************************************************
Expand Down Expand Up @@ -131,7 +117,6 @@ void *CsrPmemDebugAlloc(size_t size, CsrPmemDebugAllocType type, const char* fil
#define CsrPmemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const char* file, u32 line);
#define CsrPmemFree(ptr) CsrPmemDebugFree(ptr, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void CsrSchedBgintSet(CsrSchedBgint bgint);
* obey the convention that when a message built with CsrPmemAlloc()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 CsrPmemFree() the message storage.
* the message will be expected to kfree() the message storage.
*
* RETURNS
* void.
Expand Down
5 changes: 3 additions & 2 deletions drivers/staging/csr/csr_utf16.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*****************************************************************************/
#include <linux/module.h>
#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_unicode.h"
#include "csr_macro.h"
Expand Down Expand Up @@ -881,7 +882,7 @@ u16 *CsrUtf16String2XML(u16 *str)

*outputString++ = 0;

CsrPmemFree(str);
kfree(str);
}
}

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

*outputString++ = 0;

CsrPmemFree(str);
kfree(str);
}
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/csr/csr_wifi_nme_ap_free_downstream_contents.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*****************************************************************************/

/* Note: this is an auto-generated file. */

#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_wifi_nme_ap_prim.h"
#include "csr_wifi_nme_ap_lib.h"
Expand Down Expand Up @@ -41,7 +41,7 @@ void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message)
case CSR_WIFI_NME_AP_CONFIG_SET_REQ:
{
CsrWifiNmeApConfigSetReq *p = (CsrWifiNmeApConfigSetReq *)message;
CsrPmemFree(p->apMacConfig.macAddressList);
kfree(p->apMacConfig.macAddressList);
p->apMacConfig.macAddressList = NULL;
break;
}
Expand All @@ -54,7 +54,7 @@ void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message)
switch (p->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
CsrPmemFree(p->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
kfree(p->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
p->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase = NULL;
break;
default:
Expand All @@ -68,11 +68,11 @@ void CsrWifiNmeApFreeDownstreamMessageContents(u16 eventClass, void *message)
u16 i3;
for (i3 = 0; i3 < p->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
CsrPmemFree(p->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
kfree(p->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
p->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = NULL;
}
}
CsrPmemFree(p->p2pGoParam.operatingChanList.channelEntryList);
kfree(p->p2pGoParam.operatingChanList.channelEntryList);
p->p2pGoParam.operatingChanList.channelEntryList = NULL;
break;
}
Expand Down
15 changes: 8 additions & 7 deletions drivers/staging/csr/csr_wifi_nme_ap_serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/* Note: this is an auto-generated file. */
#include <linux/string.h>
#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_msgconv.h"
#include "csr_unicode.h"
Expand All @@ -22,7 +23,7 @@

void CsrWifiNmeApPfree(void *ptr)
{
CsrPmemFree(ptr);
kfree(ptr);
}


Expand Down Expand Up @@ -221,8 +222,8 @@ void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length)
void CsrWifiNmeApConfigSetReqSerFree(void *voidPrimitivePointer)
{
CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) voidPrimitivePointer;
CsrPmemFree(primitive->apMacConfig.macAddressList);
CsrPmemFree(primitive);
kfree(primitive->apMacConfig.macAddressList);
kfree(primitive);
}


Expand Down Expand Up @@ -555,7 +556,7 @@ void CsrWifiNmeApStartReqSerFree(void *voidPrimitivePointer)
switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase)
{
case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE:
CsrPmemFree(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
kfree(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase);
break;
default:
break;
Expand All @@ -568,11 +569,11 @@ void CsrWifiNmeApStartReqSerFree(void *voidPrimitivePointer)
u16 i3;
for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++)
{
CsrPmemFree(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
kfree(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel);
}
}
CsrPmemFree(primitive->p2pGoParam.operatingChanList.channelEntryList);
CsrPmemFree(primitive);
kfree(primitive->p2pGoParam.operatingChanList.channelEntryList);
kfree(primitive);
}


Expand Down
24 changes: 12 additions & 12 deletions drivers/staging/csr/csr_wifi_router_ctrl_free_downstream_contents.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*****************************************************************************/

/* Note: this is an auto-generated file. */

#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_wifi_router_ctrl_prim.h"
#include "csr_wifi_router_ctrl_lib.h"
Expand Down Expand Up @@ -41,62 +41,62 @@ void CsrWifiRouterCtrlFreeDownstreamMessageContents(u16 eventClass, void *messag
case CSR_WIFI_ROUTER_CTRL_HIP_REQ:
{
CsrWifiRouterCtrlHipReq *p = (CsrWifiRouterCtrlHipReq *)message;
CsrPmemFree(p->mlmeCommand);
kfree(p->mlmeCommand);
p->mlmeCommand = NULL;
CsrPmemFree(p->dataRef1);
kfree(p->dataRef1);
p->dataRef1 = NULL;
CsrPmemFree(p->dataRef2);
kfree(p->dataRef2);
p->dataRef2 = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_RES:
{
CsrWifiRouterCtrlMulticastAddressRes *p = (CsrWifiRouterCtrlMulticastAddressRes *)message;
CsrPmemFree(p->getAddresses);
kfree(p->getAddresses);
p->getAddresses = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_TCLAS_ADD_REQ:
{
CsrWifiRouterCtrlTclasAddReq *p = (CsrWifiRouterCtrlTclasAddReq *)message;
CsrPmemFree(p->tclas);
kfree(p->tclas);
p->tclas = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_TCLAS_DEL_REQ:
{
CsrWifiRouterCtrlTclasDelReq *p = (CsrWifiRouterCtrlTclasDelReq *)message;
CsrPmemFree(p->tclas);
kfree(p->tclas);
p->tclas = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_REQ:
{
CsrWifiRouterCtrlWifiOnReq *p = (CsrWifiRouterCtrlWifiOnReq *)message;
CsrPmemFree(p->data);
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_RES:
{
CsrWifiRouterCtrlWifiOnRes *p = (CsrWifiRouterCtrlWifiOnRes *)message;
CsrPmemFree(p->smeVersions.smeBuild);
kfree(p->smeVersions.smeBuild);
p->smeVersions.smeBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_PKT_REQ:
{
CsrWifiRouterCtrlWapiRxPktReq *p = (CsrWifiRouterCtrlWapiRxPktReq *)message;
CsrPmemFree(p->signal);
kfree(p->signal);
p->signal = NULL;
CsrPmemFree(p->data);
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_PKT_REQ:
{
CsrWifiRouterCtrlWapiUnicastTxPktReq *p = (CsrWifiRouterCtrlWapiUnicastTxPktReq *)message;
CsrPmemFree(p->data);
kfree(p->data);
p->data = NULL;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*****************************************************************************/

/* Note: this is an auto-generated file. */

#include <linux/slab.h>
#include "csr_pmem.h"
#include "csr_wifi_router_ctrl_prim.h"
#include "csr_wifi_router_ctrl_lib.h"
Expand Down Expand Up @@ -41,41 +41,41 @@ void CsrWifiRouterCtrlFreeUpstreamMessageContents(u16 eventClass, void *message)
case CSR_WIFI_ROUTER_CTRL_HIP_IND:
{
CsrWifiRouterCtrlHipInd *p = (CsrWifiRouterCtrlHipInd *)message;
CsrPmemFree(p->mlmeCommand);
kfree(p->mlmeCommand);
p->mlmeCommand = NULL;
CsrPmemFree(p->dataRef1);
kfree(p->dataRef1);
p->dataRef1 = NULL;
CsrPmemFree(p->dataRef2);
kfree(p->dataRef2);
p->dataRef2 = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_MULTICAST_ADDRESS_IND:
{
CsrWifiRouterCtrlMulticastAddressInd *p = (CsrWifiRouterCtrlMulticastAddressInd *)message;
CsrPmemFree(p->setAddresses);
kfree(p->setAddresses);
p->setAddresses = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WIFI_ON_IND:
{
CsrWifiRouterCtrlWifiOnInd *p = (CsrWifiRouterCtrlWifiOnInd *)message;
CsrPmemFree(p->versions.routerBuild);
kfree(p->versions.routerBuild);
p->versions.routerBuild = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_RX_MIC_CHECK_IND:
{
CsrWifiRouterCtrlWapiRxMicCheckInd *p = (CsrWifiRouterCtrlWapiRxMicCheckInd *)message;
CsrPmemFree(p->signal);
kfree(p->signal);
p->signal = NULL;
CsrPmemFree(p->data);
kfree(p->data);
p->data = NULL;
break;
}
case CSR_WIFI_ROUTER_CTRL_WAPI_UNICAST_TX_ENCRYPT_IND:
{
CsrWifiRouterCtrlWapiUnicastTxEncryptInd *p = (CsrWifiRouterCtrlWapiUnicastTxEncryptInd *)message;
CsrPmemFree(p->data);
kfree(p->data);
p->data = NULL;
break;
}
Expand Down
Loading

0 comments on commit 55a2705

Please sign in to comment.