Commit ab891115 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Greg Kroah-Hartman

ath6kl: s|A_FREE|kfree|g

for i in $(find ./drivers/staging/ath6kl/ -name \*.[ch]) ; do \
	sed -r -i -e "s/A_FREE/kfree/g" $i; done
Tested-by: default avatarNaveen Singh <nsingh@atheros.com>
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1fec95c5
...@@ -95,12 +95,12 @@ void ...@@ -95,12 +95,12 @@ void
BMICleanup(void) BMICleanup(void)
{ {
if (pBMICmdCredits) { if (pBMICmdCredits) {
A_FREE(pBMICmdCredits); kfree(pBMICmdCredits);
pBMICmdCredits = NULL; pBMICmdCredits = NULL;
} }
if (pBMICmdBuf) { if (pBMICmdBuf) {
A_FREE(pBMICmdBuf); kfree(pBMICmdBuf);
pBMICmdBuf = NULL; pBMICmdBuf = NULL;
} }
} }
...@@ -127,12 +127,12 @@ BMIDone(struct hif_device *device) ...@@ -127,12 +127,12 @@ BMIDone(struct hif_device *device)
} }
if (pBMICmdCredits) { if (pBMICmdCredits) {
A_FREE(pBMICmdCredits); kfree(pBMICmdCredits);
pBMICmdCredits = NULL; pBMICmdCredits = NULL;
} }
if (pBMICmdBuf) { if (pBMICmdBuf) {
A_FREE(pBMICmdBuf); kfree(pBMICmdBuf);
pBMICmdBuf = NULL; pBMICmdBuf = NULL;
} }
......
...@@ -309,7 +309,7 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_ ...@@ -309,7 +309,7 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_
(MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item))); (MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item)));
if (NULL == pReqPriv->pHifScatterReq) { if (NULL == pReqPriv->pHifScatterReq) {
A_FREE(pReqPriv); kfree(pReqPriv);
break; break;
} }
/* just zero the main part of the scatter request */ /* just zero the main part of the scatter request */
...@@ -319,8 +319,8 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_ ...@@ -319,8 +319,8 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_
/* allocate a bus request for this scatter request */ /* allocate a bus request for this scatter request */
busrequest = hifAllocateBusRequest(device); busrequest = hifAllocateBusRequest(device);
if (NULL == busrequest) { if (NULL == busrequest) {
A_FREE(pReqPriv->pHifScatterReq); kfree(pReqPriv->pHifScatterReq);
A_FREE(pReqPriv); kfree(pReqPriv);
break; break;
} }
/* assign the scatter request to this bus request */ /* assign the scatter request to this bus request */
...@@ -382,11 +382,11 @@ void CleanupHIFScatterResources(struct hif_device *device) ...@@ -382,11 +382,11 @@ void CleanupHIFScatterResources(struct hif_device *device)
} }
if (pReqPriv->pHifScatterReq != NULL) { if (pReqPriv->pHifScatterReq != NULL) {
A_FREE(pReqPriv->pHifScatterReq); kfree(pReqPriv->pHifScatterReq);
pReqPriv->pHifScatterReq = NULL; pReqPriv->pHifScatterReq = NULL;
} }
A_FREE(pReqPriv); kfree(pReqPriv);
} }
} }
......
...@@ -743,7 +743,7 @@ static void DevCleanupVirtualScatterSupport(struct ar6k_device *pDev) ...@@ -743,7 +743,7 @@ static void DevCleanupVirtualScatterSupport(struct ar6k_device *pDev)
if (NULL == pReq) { if (NULL == pReq) {
break; break;
} }
A_FREE(pReq); kfree(pReq);
} }
} }
......
...@@ -108,7 +108,7 @@ static void HCIUartCleanup(struct gmbox_proto_hci_uart *pProtocol) ...@@ -108,7 +108,7 @@ static void HCIUartCleanup(struct gmbox_proto_hci_uart *pProtocol)
A_MUTEX_DELETE(&pProtocol->HCIRxLock); A_MUTEX_DELETE(&pProtocol->HCIRxLock);
A_MUTEX_DELETE(&pProtocol->HCITxLock); A_MUTEX_DELETE(&pProtocol->HCITxLock);
A_FREE(pProtocol); kfree(pProtocol);
} }
static int InitTxCreditState(struct gmbox_proto_hci_uart *pProt) static int InitTxCreditState(struct gmbox_proto_hci_uart *pProt)
......
...@@ -70,7 +70,7 @@ static void HTCCleanup(struct htc_target *target) ...@@ -70,7 +70,7 @@ static void HTCCleanup(struct htc_target *target)
for (i = 0;i < NUM_CONTROL_BUFFERS;i++) { for (i = 0;i < NUM_CONTROL_BUFFERS;i++) {
if (target->HTCControlBuffers[i].Buffer) { if (target->HTCControlBuffers[i].Buffer) {
A_FREE(target->HTCControlBuffers[i].Buffer); kfree(target->HTCControlBuffers[i].Buffer);
} }
} }
...@@ -86,7 +86,7 @@ static void HTCCleanup(struct htc_target *target) ...@@ -86,7 +86,7 @@ static void HTCCleanup(struct htc_target *target)
A_MUTEX_DELETE(&target->HTCTxLock); A_MUTEX_DELETE(&target->HTCTxLock);
} }
/* free our instance */ /* free our instance */
A_FREE(target); kfree(target);
} }
/* registered target arrival callback from the HIF layer */ /* registered target arrival callback from the HIF layer */
......
...@@ -78,7 +78,7 @@ static int SendHCICommand(struct ar3k_config_info *pConfig, ...@@ -78,7 +78,7 @@ static int SendHCICommand(struct ar3k_config_info *pConfig,
} while (false); } while (false);
if (pPacket != NULL) { if (pPacket != NULL) {
A_FREE(pPacket); kfree(pPacket);
} }
return status; return status;
...@@ -116,7 +116,7 @@ static int RecvHCIEvent(struct ar3k_config_info *pConfig, ...@@ -116,7 +116,7 @@ static int RecvHCIEvent(struct ar3k_config_info *pConfig,
} while (false); } while (false);
if (pRecvPacket != NULL) { if (pRecvPacket != NULL) {
A_FREE(pRecvPacket); kfree(pRecvPacket);
} }
return status; return status;
...@@ -203,7 +203,7 @@ int SendHCICommandWaitCommandComplete(struct ar3k_config_info *pConfig, ...@@ -203,7 +203,7 @@ int SendHCICommandWaitCommandComplete(struct ar3k_config_info *pConfig,
} while (false); } while (false);
if (pBuffer != NULL) { if (pBuffer != NULL) {
A_FREE(pBuffer); kfree(pBuffer);
} }
return status; return status;
...@@ -268,7 +268,7 @@ static int AR3KConfigureHCIBaud(struct ar3k_config_info *pConfig) ...@@ -268,7 +268,7 @@ static int AR3KConfigureHCIBaud(struct ar3k_config_info *pConfig)
} while (false); } while (false);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
return status; return status;
...@@ -304,7 +304,7 @@ static int AR3KExitMinBoot(struct ar3k_config_info *pConfig) ...@@ -304,7 +304,7 @@ static int AR3KExitMinBoot(struct ar3k_config_info *pConfig)
} }
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
return status; return status;
...@@ -328,7 +328,7 @@ static int AR3KConfigureSendHCIReset(struct ar3k_config_info *pConfig) ...@@ -328,7 +328,7 @@ static int AR3KConfigureSendHCIReset(struct ar3k_config_info *pConfig)
} }
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
return status; return status;
...@@ -382,7 +382,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig) ...@@ -382,7 +382,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig)
&pEvent, &pEvent,
&pBufferToFree); &pBufferToFree);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
if (status) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Config Failed! \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Config Failed! \n"));
...@@ -397,7 +397,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig) ...@@ -397,7 +397,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig)
&pEvent, &pEvent,
&pBufferToFree); &pBufferToFree);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
if (status) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Config Failed! \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Config Failed! \n"));
...@@ -412,7 +412,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig) ...@@ -412,7 +412,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig)
&pEvent, &pEvent,
&pBufferToFree); &pBufferToFree);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
if (status) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Enable Failed! \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("HostWakeup Enable Failed! \n"));
...@@ -427,7 +427,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig) ...@@ -427,7 +427,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig)
&pEvent, &pEvent,
&pBufferToFree); &pBufferToFree);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
if (status) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Enable Failed! \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Target Wakeup Enable Failed! \n"));
...@@ -442,7 +442,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig) ...@@ -442,7 +442,7 @@ static int AR3KEnableTLPM(struct ar3k_config_info *pConfig)
&pEvent, &pEvent,
&pBufferToFree); &pBufferToFree);
if (pBufferToFree != NULL) { if (pBufferToFree != NULL) {
A_FREE(pBufferToFree); kfree(pBufferToFree);
} }
if (status) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Sleep Enable Failed! \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Sleep Enable Failed! \n"));
......
...@@ -222,7 +222,7 @@ int PSSendOps(void *arg) ...@@ -222,7 +222,7 @@ int PSSendOps(void *arg)
A_RELEASE_FIRMWARE(firmware); A_RELEASE_FIRMWARE(firmware);
/* Parse the PS buffer to a global variable */ /* Parse the PS buffer to a global variable */
status = AthDoParsePS(buffer,len); status = AthDoParsePS(buffer,len);
A_FREE(buffer); kfree(buffer);
} else { } else {
A_RELEASE_FIRMWARE(firmware); A_RELEASE_FIRMWARE(firmware);
} }
...@@ -256,7 +256,7 @@ int PSSendOps(void *arg) ...@@ -256,7 +256,7 @@ int PSSendOps(void *arg)
A_RELEASE_FIRMWARE(firmware); A_RELEASE_FIRMWARE(firmware);
/* parse and store the Patch file contents to a global variables */ /* parse and store the Patch file contents to a global variables */
status = AthDoParsePatch(buffer,len); status = AthDoParsePatch(buffer,len);
A_FREE(buffer); kfree(buffer);
} else { } else {
A_RELEASE_FIRMWARE(firmware); A_RELEASE_FIRMWARE(firmware);
} }
...@@ -283,7 +283,7 @@ int PSSendOps(void *arg) ...@@ -283,7 +283,7 @@ int PSSendOps(void *arg)
&bufferToFree) == 0) { &bufferToFree) == 0) {
if(ReadPSEvent(event) == 0) { /* Exit if the status is success */ if(ReadPSEvent(event) == 0) { /* Exit if the status is success */
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
#ifndef HCI_TRANSPORT_SDIO #ifndef HCI_TRANSPORT_SDIO
...@@ -295,7 +295,7 @@ int PSSendOps(void *arg) ...@@ -295,7 +295,7 @@ int PSSendOps(void *arg)
goto complete; goto complete;
} }
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
} else { } else {
status = 0; status = 0;
...@@ -312,13 +312,13 @@ int PSSendOps(void *arg) ...@@ -312,13 +312,13 @@ int PSSendOps(void *arg)
&bufferToFree) == 0) { &bufferToFree) == 0) {
if(ReadPSEvent(event) != 0) { /* Exit if the status is success */ if(ReadPSEvent(event) != 0) { /* Exit if the status is success */
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
status = 1; status = 1;
goto complete; goto complete;
} }
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
} else { } else {
status = 0; status = 0;
...@@ -376,10 +376,10 @@ int PSSendOps(void *arg) ...@@ -376,10 +376,10 @@ int PSSendOps(void *arg)
AthFreeCommandList(&HciCmdList,numCmds); AthFreeCommandList(&HciCmdList,numCmds);
} }
if(path) { if(path) {
A_FREE(path); kfree(path);
} }
if(config_path) { if(config_path) {
A_FREE(config_path); kfree(config_path);
} }
return status; return status;
} }
...@@ -511,7 +511,7 @@ int write_bdaddr(struct ar3k_config_info *pConfig,u8 *bdaddr,int type) ...@@ -511,7 +511,7 @@ int write_bdaddr(struct ar3k_config_info *pConfig,u8 *bdaddr,int type)
} }
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
return result; return result;
...@@ -527,7 +527,7 @@ int ReadVersionInfo(struct ar3k_config_info *pConfig) ...@@ -527,7 +527,7 @@ int ReadVersionInfo(struct ar3k_config_info *pConfig)
} }
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
return result; return result;
} }
...@@ -564,7 +564,7 @@ int getDeviceType(struct ar3k_config_info *pConfig, u32 *code) ...@@ -564,7 +564,7 @@ int getDeviceType(struct ar3k_config_info *pConfig, u32 *code)
} }
if(bufferToFree != NULL) { if(bufferToFree != NULL) {
A_FREE(bufferToFree); kfree(bufferToFree);
} }
return result; return result;
} }
......
...@@ -362,7 +362,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -362,7 +362,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
{ {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("error\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("error\n"));
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -401,7 +401,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -401,7 +401,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) { if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail\n"));
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -422,7 +422,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -422,7 +422,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) { if(uGetInputDataFormat(pCharLine, &stPS_DataFormat)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat fail \n"));
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -433,7 +433,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -433,7 +433,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
if (ByteCount > LINE_SIZE_MAX/2) if (ByteCount > LINE_SIZE_MAX/2)
{ {
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -449,7 +449,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -449,7 +449,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
if(uGetInputDataFormat(pCharLine,&stPS_DataFormat)) { if(uGetInputDataFormat(pCharLine,&stPS_DataFormat)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat Fail\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("uGetInputDataFormat Fail\n"));
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -510,7 +510,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -510,7 +510,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
{ {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("\n Buffer over flow PS File too big!!!")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("\n Buffer over flow PS File too big!!!"));
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
//Sleep (3000); //Sleep (3000);
...@@ -524,7 +524,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -524,7 +524,7 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
default: default:
{ {
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -541,13 +541,13 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat) ...@@ -541,13 +541,13 @@ int AthParseFilesUnified(u8 *srcbuffer,u32 srclen, int FileFormat)
{ {
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return A_ERROR; return A_ERROR;
} }
if(Buffer != NULL) { if(Buffer != NULL) {
A_FREE(Buffer); kfree(Buffer);
} }
return 0; return 0;
...@@ -609,7 +609,7 @@ int AthDoParsePatch(u8 *patchbuffer, u32 patchlen) ...@@ -609,7 +609,7 @@ int AthDoParsePatch(u8 *patchbuffer, u32 patchlen)
/* Handle case when the number of patch buffer is more than the 20K */ /* Handle case when the number of patch buffer is more than the 20K */
if(MAX_NUM_PATCH_ENTRY == Patch_Count) { if(MAX_NUM_PATCH_ENTRY == Patch_Count) {
for(i = 0; i < Patch_Count; i++) { for(i = 0; i < Patch_Count; i++) {
A_FREE(RamPatch[i].Data); kfree(RamPatch[i].Data);
} }
return A_ERROR; return A_ERROR;
} }
...@@ -812,13 +812,13 @@ int AthCreateCommandList(struct ps_cmd_packet **HciPacketList, u32 *numPackets) ...@@ -812,13 +812,13 @@ int AthCreateCommandList(struct ps_cmd_packet **HciPacketList, u32 *numPackets)
for(count = 0; count < Patch_Count; count++) { for(count = 0; count < Patch_Count; count++) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing Patch Buffer %d \r\n",count)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing Patch Buffer %d \r\n",count));
A_FREE(RamPatch[Patch_Count].Data); kfree(RamPatch[Patch_Count].Data);
} }
for(count = 0; count < Tag_Count; count++) { for(count = 0; count < Tag_Count; count++) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing PS Buffer %d \r\n",count)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing PS Buffer %d \r\n",count));
A_FREE(PsTagEntry[count].TagData); kfree(PsTagEntry[count].TagData);
} }
/* /*
...@@ -962,8 +962,8 @@ int AthFreeCommandList(struct ps_cmd_packet **HciPacketList, u32 numPackets) ...@@ -962,8 +962,8 @@ int AthFreeCommandList(struct ps_cmd_packet **HciPacketList, u32 numPackets)
return A_ERROR; return A_ERROR;
} }
for(i = 0; i < numPackets;i++) { for(i = 0; i < numPackets;i++) {
A_FREE((*HciPacketList)[i].Hcipacket); kfree((*HciPacketList)[i].Hcipacket);
} }
A_FREE(*HciPacketList); kfree(*HciPacketList);
return 0; return 0;
} }
...@@ -60,11 +60,6 @@ ...@@ -60,11 +60,6 @@
#ifndef A_MALLOC #ifndef A_MALLOC
#define A_MALLOC(size) kmalloc((size),GFP_KERNEL) #define A_MALLOC(size) kmalloc((size),GFP_KERNEL)
#endif /* A_MALLOC */ #endif /* A_MALLOC */
#ifndef A_FREE
#define A_FREE(addr) kfree((addr))
#endif /* A_MALLOC */
#endif /* HCI_TRANSPORT_UART */ #endif /* HCI_TRANSPORT_UART */
/* String manipulation APIs */ /* String manipulation APIs */
......
...@@ -982,7 +982,7 @@ ar6000_softmac_update(struct ar6_softc *ar, u8 *eeprom_data, size_t size) ...@@ -982,7 +982,7 @@ ar6000_softmac_update(struct ar6_softc *ar, u8 *eeprom_data, size_t size)
} }
source = "softmac file"; source = "softmac file";
} }
A_FREE(macbuf); kfree(macbuf);
} }
A_RELEASE_FIRMWARE(softmac_entry); A_RELEASE_FIRMWARE(softmac_entry);
} }
...@@ -2134,7 +2134,7 @@ ar6000_destroy(struct net_device *dev, unsigned int unregister) ...@@ -2134,7 +2134,7 @@ ar6000_destroy(struct net_device *dev, unsigned int unregister)
#ifdef HTC_RAW_INTERFACE #ifdef HTC_RAW_INTERFACE
if (ar->arRawHtc) { if (ar->arRawHtc) {
A_FREE(ar->arRawHtc); kfree(ar->arRawHtc);
ar->arRawHtc = NULL; ar->arRawHtc = NULL;
} }
#endif #endif
...@@ -4883,7 +4883,7 @@ ar6000_neighborReport_event(struct ar6_softc *ar, int numAps, WMI_NEIGHBOR_INFO ...@@ -4883,7 +4883,7 @@ ar6000_neighborReport_event(struct ar6_softc *ar, int numAps, WMI_NEIGHBOR_INFO
memcpy(pmkcand->bssid.sa_data, info->bssid, ATH_MAC_LEN); memcpy(pmkcand->bssid.sa_data, info->bssid, ATH_MAC_LEN);
wrqu.data.length = sizeof(struct iw_pmkid_cand); wrqu.data.length = sizeof(struct iw_pmkid_cand);
wireless_send_event(ar->arNetDev, IWEVPMKIDCAND, &wrqu, (char *)pmkcand); wireless_send_event(ar->arNetDev, IWEVPMKIDCAND, &wrqu, (char *)pmkcand);
A_FREE(pmkcand); kfree(pmkcand);
#else /* WIRELESS_EXT >= 18 */ #else /* WIRELESS_EXT >= 18 */
snprintf(buf, sizeof(buf), "%s%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", snprintf(buf, sizeof(buf), "%s%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
tag, tag,
...@@ -5603,7 +5603,7 @@ void ar6000_send_event_to_app(struct ar6_softc *ar, u16 eventId, ...@@ -5603,7 +5603,7 @@ void ar6000_send_event_to_app(struct ar6_softc *ar, u16 eventId,
A_MEMZERO(&wrqu, sizeof(wrqu)); A_MEMZERO(&wrqu, sizeof(wrqu));
wrqu.data.length = size; wrqu.data.length = size;
wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf); wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
A_FREE(buf); kfree(buf);
#endif #endif
...@@ -5648,7 +5648,7 @@ void ar6000_send_generic_event_to_app(struct ar6_softc *ar, u16 eventId, ...@@ -5648,7 +5648,7 @@ void ar6000_send_generic_event_to_app(struct ar6_softc *ar, u16 eventId,
wrqu.data.length = size; wrqu.data.length = size;
wireless_send_event(ar->arNetDev, IWEVGENIE, &wrqu, buf); wireless_send_event(ar->arNetDev, IWEVGENIE, &wrqu, buf);
A_FREE(buf); kfree(buf);
#endif /* (WIRELESS_EXT >= 18) */ #endif /* (WIRELESS_EXT >= 18) */
......
...@@ -318,7 +318,7 @@ void ar6k_cleanup_hci_pal(void *ar_p) ...@@ -318,7 +318,7 @@ void ar6k_cleanup_hci_pal(void *ar_p)
if (pHciPalInfo != NULL) { if (pHciPalInfo != NULL) {
bt_cleanup_hci_pal(pHciPalInfo); bt_cleanup_hci_pal(pHciPalInfo);
A_FREE(pHciPalInfo); kfree(pHciPalInfo);
ar->hcipal_info = NULL; ar->hcipal_info = NULL;
} }
} }
......
...@@ -552,7 +552,7 @@ ar6k_cfg80211_connect_event(struct ar6_softc *ar, u16 channel, ...@@ -552,7 +552,7 @@ ar6k_cfg80211_connect_event(struct ar6_softc *ar, u16 channel,
ibss_channel, mgmt, ibss_channel, mgmt,
le16_to_cpu(size), le16_to_cpu(size),
signal, GFP_KERNEL); signal, GFP_KERNEL);
A_FREE(ieeemgmtbuf); kfree(ieeemgmtbuf);
cfg80211_put_bss(bss); cfg80211_put_bss(bss);
} }
...@@ -729,7 +729,7 @@ ar6k_cfg80211_scan_node(void *arg, bss_t *ni) ...@@ -729,7 +729,7 @@ ar6k_cfg80211_scan_node(void *arg, bss_t *ni)
le16_to_cpu(size), le16_to_cpu(size),
signal, GFP_KERNEL); signal, GFP_KERNEL);
A_FREE (ieeemgmtbuf); kfree (ieeemgmtbuf);
} }
static int static int
......
...@@ -582,11 +582,11 @@ void ar6000_cleanup_hci(struct ar6_softc *ar) ...@@ -582,11 +582,11 @@ void ar6000_cleanup_hci(struct ar6_softc *ar)
} }
if (pHcidevInfo->pHTCStructAlloc != NULL) { if (pHcidevInfo->pHTCStructAlloc != NULL) {
A_FREE(pHcidevInfo->pHTCStructAlloc); kfree(pHcidevInfo->pHTCStructAlloc);
pHcidevInfo->pHTCStructAlloc = NULL; pHcidevInfo->pHTCStructAlloc = NULL;
} }
A_FREE(pHcidevInfo); kfree(pHcidevInfo);
#ifndef EXPORT_HCI_BRIDGE_INTERFACE #ifndef EXPORT_HCI_BRIDGE_INTERFACE
ar->hcidev_info = NULL; ar->hcidev_info = NULL;
#endif #endif
......
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
#define A_MEMZERO(addr, len) memset(addr, 0, len) #define A_MEMZERO(addr, len) memset(addr, 0, len)
#define A_MALLOC(size) kmalloc((size), GFP_KERNEL) #define A_MALLOC(size) kmalloc((size), GFP_KERNEL)
#define A_MALLOC_NOWAIT(size) kmalloc((size), GFP_ATOMIC) #define A_MALLOC_NOWAIT(size) kmalloc((size), GFP_ATOMIC)
#define A_FREE(addr) kfree(addr)
#if defined(ANDROID_ENV) && defined(CONFIG_ANDROID_LOGGER) #if defined(ANDROID_ENV) && defined(CONFIG_ANDROID_LOGGER)
extern unsigned int enablelogcat; extern unsigned int enablelogcat;
...@@ -364,7 +363,6 @@ static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) { ...@@ -364,7 +363,6 @@ static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) {
#define A_MEMZERO(addr, len) memset((addr), 0, (len)) #define A_MEMZERO(addr, len) memset((addr), 0, (len))
#define A_MALLOC(size) malloc(size) #define A_MALLOC(size) malloc(size)
#define A_FREE(addr) free(addr)
#ifdef ANDROID #ifdef ANDROID
#ifndef err #ifndef err
......
...@@ -2132,7 +2132,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2132,7 +2132,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (copy_to_user(rq->ifr_data, buffer, length)) { if (copy_to_user(rq->ifr_data, buffer, length)) {
ret = -EFAULT; ret = -EFAULT;
} }
A_FREE(buffer); kfree(buffer);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
} }
...@@ -2155,7 +2155,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2155,7 +2155,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
} else { } else {
ret = BMIWriteMemory(hifDevice, address, buffer, length); ret = BMIWriteMemory(hifDevice, address, buffer, length);
} }
A_FREE(buffer); kfree(buffer);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
} }
...@@ -2308,7 +2308,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2308,7 +2308,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
} else { } else {
ret = BMILZData(hifDevice, buffer, length); ret = BMILZData(hifDevice, buffer, length);
} }
A_FREE(buffer); kfree(buffer);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
} }
...@@ -3822,7 +3822,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -3822,7 +3822,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
ret = BMIrompatchDeactivate(hifDevice, rompatch_count, (u32 *)buffer); ret = BMIrompatchDeactivate(hifDevice, rompatch_count, (u32 *)buffer);
} }
} }
A_FREE(buffer); kfree(buffer);
} else { } else {
ret = -ENOMEM; ret = -ENOMEM;
} }
......
...@@ -123,7 +123,7 @@ aggr_delete_tid_state(struct aggr_info *p_aggr, u8 tid) ...@@ -123,7 +123,7 @@ aggr_delete_tid_state(struct aggr_info *p_aggr, u8 tid)
rxtid->hold_q_sz = 0; rxtid->hold_q_sz = 0;
if(rxtid->hold_q) { if(rxtid->hold_q) {
A_FREE(rxtid->hold_q); kfree(rxtid->hold_q);
rxtid->hold_q = NULL; rxtid->hold_q = NULL;
} }
...@@ -154,7 +154,7 @@ aggr_module_destroy(void *cntxt) ...@@ -154,7 +154,7 @@ aggr_module_destroy(void *cntxt)
A_NETBUF_FREE(rxtid->hold_q[k].osbuf); A_NETBUF_FREE(rxtid->hold_q[k].osbuf);
} }
} }
A_FREE(rxtid->hold_q); kfree(rxtid->hold_q);
} }
/* Free the dispatch q contents*/ /* Free the dispatch q contents*/
while(A_NETBUF_QUEUE_SIZE(&rxtid->q)) { while(A_NETBUF_QUEUE_SIZE(&rxtid->q)) {
...@@ -168,7 +168,7 @@ aggr_module_destroy(void *cntxt) ...@@ -168,7 +168,7 @@ aggr_module_destroy(void *cntxt)
while(A_NETBUF_QUEUE_SIZE(&p_aggr->freeQ)) { while(A_NETBUF_QUEUE_SIZE(&p_aggr->freeQ)) {
A_NETBUF_FREE(A_NETBUF_DEQUEUE(&p_aggr->freeQ)); A_NETBUF_FREE(A_NETBUF_DEQUEUE(&p_aggr->freeQ));
} }
A_FREE(p_aggr); kfree(p_aggr);
} }
A_PRINTF("out aggr_module_destroy\n"); A_PRINTF("out aggr_module_destroy\n");
} }
......
...@@ -72,7 +72,7 @@ wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size) ...@@ -72,7 +72,7 @@ wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size)
{ {
ni->ni_buf = A_MALLOC_NOWAIT(wh_size); ni->ni_buf = A_MALLOC_NOWAIT(wh_size);
if (ni->ni_buf == NULL) { if (ni->ni_buf == NULL) {
A_FREE(ni); kfree(ni);
ni = NULL; ni = NULL;
return ni; return ni;
} }
...@@ -104,9 +104,9 @@ void ...@@ -104,9 +104,9 @@ void
wlan_node_free(bss_t *ni) wlan_node_free(bss_t *ni)
{ {
if (ni->ni_buf != NULL) { if (ni->ni_buf != NULL) {
A_FREE(ni->ni_buf); kfree(ni->ni_buf);
} }
A_FREE(ni); kfree(ni);
} }
void void
......
...@@ -381,7 +381,7 @@ wmi_shutdown(struct wmi_t *wmip) ...@@ -381,7 +381,7 @@ wmi_shutdown(struct wmi_t *wmip)
A_MUTEX_DELETE(&wmip->wmi_lock); A_MUTEX_DELETE(&wmip->wmi_lock);
#endif #endif
} }
A_FREE(wmip); kfree(wmip);
} }
} }
...@@ -5877,7 +5877,7 @@ wmi_scan_indication (struct wmi_t *wmip) ...@@ -5877,7 +5877,7 @@ wmi_scan_indication (struct wmi_t *wmip)
ar6000_scan_indication (wmip->wmi_devt, pAr6kScanIndEvent, size); ar6000_scan_indication (wmip->wmi_devt, pAr6kScanIndEvent, size);
A_FREE(pAr6kScanIndEvent); kfree(pAr6kScanIndEvent);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment