From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755887Ab3IZCMh (ORCPT ); Wed, 25 Sep 2013 22:12:37 -0400 Received: from mga03.intel.com ([143.182.124.21]:16056 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753314Ab3IZCMf (ORCPT ); Wed, 25 Sep 2013 22:12:35 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,982,1371106800"; d="scan'208";a="401177191" Date: Thu, 26 Sep 2013 10:12:23 +0800 From: Fengguang Wu To: Greg Kroah-Hartman Cc: Lidza Louina , kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: [PATCH staging] dgnc: remove useless cast on kzalloc() Message-ID: <20130926021223.GB10435@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/staging/dgnc/dgnc_driver.c:510:3-7: WARNING: casting value returned by k[cmz]alloc to (char *) is useless. drivers/staging/dgnc/dgnc_driver.c:502:2-19: WARNING: casting value returned by k[cmz]alloc to (struct dgnc_board *) is useless. Casting (void *) value returned by kmalloc is useless as mentioned in Documentation/CodingStyle, Chap 14. Generated by: coccinelle/api/alloc/drop_kmalloc_cast.cocci CC: Lidza Louina CC: Greg Kroah-Hartman Signed-off-by: Fengguang Wu --- drivers/staging/dgnc/dgnc_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- linux-next.orig/drivers/staging/dgnc/dgnc_driver.c 2013-09-26 10:04:27.000000000 +0800 +++ linux-next/drivers/staging/dgnc/dgnc_driver.c 2013-09-26 10:07:56.003128273 +0800 @@ -499,7 +499,7 @@ static int dgnc_found_board(struct pci_d /* 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_d /* 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"));