From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932786AbcJMQLg (ORCPT ); Thu, 13 Oct 2016 12:11:36 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:53393 "EHLO s-opensource.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754383AbcJMQLP (ORCPT ); Thu, 13 Oct 2016 12:11:15 -0400 From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Javier Martinez Canillas , iss_storagedev@hp.com, linux-scsi@vger.kernel.org, "James E.J. Bottomley" , esc.storagedev@microsemi.com, Don Brace , "Martin K. Petersen" Subject: [PATCH] scsi: hpsa: remove unneeded void pointer cast Date: Thu, 13 Oct 2016 13:10:08 -0300 Message-Id: <1476375008-10034-1-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's not necessary to cast the result of kmalloc, since void pointers are promoted to any other type. This also fixes following coccinelle warning: casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless. Signed-off-by: Javier Martinez Canillas --- drivers/scsi/hpsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index d007ec18179a..4e82b692298e 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -6657,8 +6657,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp) return -EINVAL; if (!capable(CAP_SYS_RAWIO)) return -EPERM; - ioc = (BIG_IOCTL_Command_struct *) - kmalloc(sizeof(*ioc), GFP_KERNEL); + ioc = kmalloc(sizeof(*ioc), GFP_KERNEL); if (!ioc) { status = -ENOMEM; goto cleanup1; -- 2.7.4