Skip to contentSkip to conversation

staging: dgnc: driver.c: casting (void *)value returned by kzalloc is useless

PATCH In review Duan Jiong 2 participants 2 messages Sep 5, 2013 – Sep 25, 2013 Staging

lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 staging: dgnc: driver.c: casting (void *)value returned by kzalloc is useless

From: Duan Jiong <[email protected]>

Casting (void *) value returned by kzalloc is useless as mentioned in Documentation/CodingStyle, Chap 14.

---
 drivers/staging/dgnc/dgnc_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +2 -2
index f8c1e22..ac64181 100644
@@ -499,7 +499,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* get the board structure and prep it */
 	brd = dgnc_Board[dgnc_NumBoards] =
-	(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
+			kzalloc(sizeof(struct board_t), GFP_KERNEL);
 	if (!brd) {
 		APR(("memory allocation for board structure failed\n"));
 		return(-ENOMEM);
@@ -507,7 +507,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 
 	/* 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);
 		APR(("memory allocation for board msgbuf failed\n"));
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 6 lines · Duan Jiong

From: Duan Jiong <[email protected]>

Casting (void *) value returned by kzalloc is useless as mentioned in Documentation/CodingStyle, Chap 14.

No longer applies, please redo against the latest linux-next release.

thanks,

greg k-h