From 3701befc44eb9b0e5a0e0b7169448658919b9850 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Wed, 10 Nov 2010 21:31:38 +0100 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/bcm/Misc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'drivers/staging/bcm/Misc.c') diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c index 82d9f86821c..1bb6a1d97ce 100644 --- a/drivers/staging/bcm/Misc.c +++ b/drivers/staging/bcm/Misc.c @@ -71,8 +71,7 @@ InitAdapter(PMINI_ADAPTER psAdapter) default_wimax_protocol_initialize(psAdapter); for (i=0;itxctlpacket[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"); -- cgit v1.2.3