All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hounschell <markh@compro.net>
To: Daeseok Youn <daeseok.youn@gmail.com>,
	lidza.louina@gmail.com, gregkh@linuxfoundation.org
Cc: driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: dgap: remove useless cast on kzalloc()
Date: Thu, 06 Mar 2014 07:57:17 -0500	[thread overview]
Message-ID: <531870AD.1080403@compro.net> (raw)
In-Reply-To: <920618656.203780.1394086679844.JavaMail.root@mx2.compro.net>

On 03/06/2014 01:17 AM, Daeseok Youn wrote:
>
> 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.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>   drivers/staging/dgap/dgap.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
> index cbce457..1adcd13 100644
> --- a/drivers/staging/dgap/dgap.c
> +++ b/drivers/staging/dgap/dgap.c
> @@ -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);
>   	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

       reply	other threads:[~2014-03-06 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <920618656.203780.1394086679844.JavaMail.root@mx2.compro.net>
2014-03-06 12:57 ` Mark Hounschell [this message]
2014-03-06  6:17 [PATCH] staging: dgap: remove useless cast on kzalloc() Daeseok Youn

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=531870AD.1080403@compro.net \
    --to=markh@compro.net \
    --cc=daeseok.youn@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lidza.louina@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.