mirror of
https://github.com/torvalds/linux.git
synced 2025-01-01 15:51:46 +00:00
Staging, bcm: Remove unnecessary casts of void ptr returning alloc function return values
Here's a patch against a copy of linux-next that I just cloned. Don't pointlessly cast pointers returned by allocation functions that return void pointers which are implicitly converted. For drivers/staging/bcm/ Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
afabbe6db3
commit
3701befc44
@ -1702,7 +1702,7 @@ ULONG StoreCmControlResponseMessage(PMINI_ADAPTER Adapter,PVOID pvBuffer,UINT *p
|
||||
}
|
||||
// For DSA_REQ, only upto "psfAuthorizedSet" parameter should be accessed by driver!
|
||||
|
||||
pstAddIndication=(stLocalSFAddIndication *)kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
|
||||
pstAddIndication=kmalloc(sizeof(*pstAddIndication), GFP_KERNEL);
|
||||
if(NULL==pstAddIndication)
|
||||
return 0;
|
||||
|
||||
|
@ -5,15 +5,14 @@ int InterfaceFileDownload( PVOID arg,
|
||||
struct file *flp,
|
||||
unsigned int on_chip_loc)
|
||||
{
|
||||
char *buff=NULL;
|
||||
// unsigned int reg=0;
|
||||
mm_segment_t oldfs={0};
|
||||
int errno=0, len=0 /*,is_config_file = 0*/;
|
||||
loff_t pos=0;
|
||||
PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg;
|
||||
//PMINI_ADAPTER Adapter = psIntfAdapter->psAdapter;
|
||||
char *buff=kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_KERNEL);
|
||||
|
||||
buff=(PCHAR)kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_KERNEL);
|
||||
if(!buff)
|
||||
{
|
||||
return -ENOMEM;
|
||||
@ -56,7 +55,7 @@ int InterfaceFileReadbackFromChip( PVOID arg,
|
||||
struct file *flp,
|
||||
unsigned int on_chip_loc)
|
||||
{
|
||||
char *buff=NULL, *buff_readback=NULL;
|
||||
char *buff, *buff_readback;
|
||||
unsigned int reg=0;
|
||||
mm_segment_t oldfs={0};
|
||||
int errno=0, len=0, is_config_file = 0;
|
||||
@ -65,8 +64,8 @@ int InterfaceFileReadbackFromChip( PVOID arg,
|
||||
INT Status = STATUS_SUCCESS;
|
||||
PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg;
|
||||
|
||||
buff=(PCHAR)kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_DMA);
|
||||
buff_readback=(PCHAR)kmalloc(MAX_TRANSFER_CTRL_BYTE_USB , GFP_DMA);
|
||||
buff=kmalloc(MAX_TRANSFER_CTRL_BYTE_USB, GFP_DMA);
|
||||
buff_readback=kmalloc(MAX_TRANSFER_CTRL_BYTE_USB , GFP_DMA);
|
||||
if(!buff || !buff_readback)
|
||||
{
|
||||
kfree(buff);
|
||||
@ -287,7 +286,7 @@ int bcm_ioctl_fw_download(PMINI_ADAPTER Adapter, FIRMWARE_INFO *psFwInfo)
|
||||
else
|
||||
{
|
||||
|
||||
buff = (PUCHAR)kzalloc(psFwInfo->u32FirmwareLength,GFP_KERNEL);
|
||||
buff = kzalloc(psFwInfo->u32FirmwareLength,GFP_KERNEL);
|
||||
if(buff==NULL)
|
||||
{
|
||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"Failed in allocation memory");
|
||||
@ -345,11 +344,10 @@ static INT buffRdbkVerify(PMINI_ADAPTER Adapter,
|
||||
PUCHAR mappedbuffer, UINT u32FirmwareLength,
|
||||
ULONG u32StartingAddress)
|
||||
{
|
||||
PUCHAR readbackbuff = NULL;
|
||||
UINT len = u32FirmwareLength;
|
||||
INT retval = STATUS_SUCCESS;
|
||||
PUCHAR readbackbuff = kzalloc(MAX_TRANSFER_CTRL_BYTE_USB,GFP_KERNEL);
|
||||
|
||||
readbackbuff = (PUCHAR)kzalloc(MAX_TRANSFER_CTRL_BYTE_USB,GFP_KERNEL);
|
||||
if(NULL == readbackbuff)
|
||||
{
|
||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "MEMORY ALLOCATION FAILED");
|
||||
|
@ -71,8 +71,7 @@ InitAdapter(PMINI_ADAPTER psAdapter)
|
||||
default_wimax_protocol_initialize(psAdapter);
|
||||
for (i=0;i<MAX_CNTRL_PKTS;i++)
|
||||
{
|
||||
psAdapter->txctlpacket[i] = (char *)kmalloc(MAX_CNTL_PKT_SIZE,
|
||||
GFP_KERNEL);
|
||||
psAdapter->txctlpacket[i] = kmalloc(MAX_CNTL_PKT_SIZE, GFP_KERNEL);
|
||||
if(!psAdapter->txctlpacket[i])
|
||||
{
|
||||
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "No More Cntl pkts got, max got is %d", i);
|
||||
@ -1228,11 +1227,11 @@ static int bcm_parse_target_params(PMINI_ADAPTER Adapter)
|
||||
{
|
||||
struct file *flp=NULL;
|
||||
mm_segment_t oldfs={0};
|
||||
char *buff = NULL;
|
||||
char *buff;
|
||||
int len = 0;
|
||||
loff_t pos = 0;
|
||||
|
||||
buff=(PCHAR)kmalloc(BUFFER_1K, GFP_KERNEL);
|
||||
buff=kmalloc(BUFFER_1K, GFP_KERNEL);
|
||||
if(!buff)
|
||||
{
|
||||
return -ENOMEM;
|
||||
@ -1393,12 +1392,10 @@ static VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
|
||||
#if 0
|
||||
static unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter, ulong dwAddress)
|
||||
{
|
||||
unsigned char *pucmacaddr = NULL;
|
||||
int status = 0, i=0;
|
||||
unsigned int temp =0;
|
||||
int status = 0, i = 0;
|
||||
unsigned int temp = 0;
|
||||
unsigned char *pucmacaddr = kmalloc(MAC_ADDRESS_SIZE, GFP_KERNEL);
|
||||
|
||||
|
||||
pucmacaddr = (unsigned char *)kmalloc(MAC_ADDRESS_SIZE, GFP_KERNEL);
|
||||
if(!pucmacaddr)
|
||||
{
|
||||
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "No Buffers to Read the EEPROM Address\n");
|
||||
|
Loading…
Reference in New Issue
Block a user