Skip to contentSkip to conversation

staging: dgap: remove useless cast on kzalloc()

PATCH Mark Hounschell 1 participant 1 message Mar 6, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 23 lines · Daeseok Youn

coccinelle warning:
drivers/staging/dgap/dgap.c:782:3-7: WARNING:
casting value returned by k[cmz]alloc to (char *) is useless.
drivers/staging/dgap/dgap.c:776:2-16: WARNING:
casting value returned by k[cmz]alloc to (struct board_t *) is useless.

---
  drivers/staging/dgap/dgap.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgap/dgap.c +1 -1
index cbce457..1adcd13 100644
@@ -773,13 +773,13 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
 
  	/* get the board structure and prep it */
  	brd = dgap_Board[dgap_NumBoards] =
-	(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
+		kzalloc(sizeof(struct board_t), GFP_KERNEL);

drivers/staging/dgap/dgap.c static int dgap_found_board(struct pci_dev *pdev, int id) · line 785

Quoted 10 lines
drivers/staging/dgap/dgap.c +1 -1
  	if (!brd)
  		return -ENOMEM;
 
  	/* make a temporary message buffer for the boot messages */
  	brd->msgbuf = brd->msgbuf_head =
-		(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
+		kzalloc(sizeof(char) * 8192, GFP_KERNEL);
  	if (!brd->msgbuf) {
  		kfree(brd);
  		return -ENOMEM;

I'm pretty sure this has already been fixed up in current staging-next.

Thanks
Mark