mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Don Brace <brace77070@gmail.com>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: iss_storagedev@hp.com, linux-scsi@vger.kernel.org,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	esc.storagedev@microsemi.com,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: hpsa: remove unneeded void pointer cast
Date: Thu, 13 Oct 2016 15:45:00 -0500	[thread overview]
Message-ID: <f1733716-eb19-b623-69bf-5dca1d9f5b57@microsemi.com> (raw)
In-Reply-To: <1476375008-10034-1-git-send-email-javier@osg.samsung.com>

On 10/13/2016 11:10 AM, Javier Martinez Canillas wrote:
> 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 <javier@osg.samsung.com>
> ---
>
>   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;
Acked-by: Don Brace <don.brace@microsemi.com>

  reply	other threads:[~2016-10-13 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-13 16:10 Javier Martinez Canillas
2016-10-13 20:45 ` Don Brace [this message]
2016-10-14 20:23 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f1733716-eb19-b623-69bf-5dca1d9f5b57@microsemi.com \
    --to=brace77070@gmail.com \
    --cc=esc.storagedev@microsemi.com \
    --cc=iss_storagedev@hp.com \
    --cc=javier@osg.samsung.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®