All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	alan@linux.intel.com
Subject: Re: [PATCH] staging: goldfish_audio.c: sparse warning of incorrect type
Date: Mon, 1 Sep 2014 17:19:35 +0530	[thread overview]
Message-ID: <20140901114935.GA8617@sudip-PC> (raw)
In-Reply-To: <20140901093514.GE5122@mwanda>

On Mon, Sep 01, 2014 at 12:35:14PM +0300, Dan Carpenter wrote:
> On Sun, Aug 31, 2014 at 09:46:22PM +0530, Sudip Mukherjee wrote:
> > @@ -133,9 +134,15 @@ static ssize_t goldfish_audio_read(struct file *fp, char __user *buf,
> >  						AUDIO_READ_BUFFER_AVAILABLE);
> >  
> >  		/* copy data to user space */
> > -		if (copy_to_user(buf, data->read_buffer, length))
> > +		buffer = kzalloc(length, GFP_KERNEL);
> > +		if (buffer == NULL)
> > +			return -ENOMEM;
> > +		memcpy_fromio(buffer, data->read_buffer, length);
> > +		if (copy_to_user((void __user *)buf, buffer, length)) {
>                                  ^^^^^^^^^^^^^^^
> This cast shouldn't be needed.
> 
> regards,
> dan carpenter
> 

yes , its not needed . I just checked it again after removing the cast. Actually I gave it as sparse was showing warning for argument 1 also. I should have rechecked it after fixing the warning for argument2. Sorry for it.
Anyways, if Alan confirms that this patch is actually needed then I will resubmit a modified patch.

thanks
Sudip

      reply	other threads:[~2014-09-01 11:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-31 16:16 [PATCH] staging: goldfish_audio.c: sparse warning of incorrect type Sudip Mukherjee
2014-08-31 20:02 ` Greg Kroah-Hartman
2014-09-01 12:39   ` Alan Cox
2014-09-01  9:35 ` Dan Carpenter
2014-09-01 11:49   ` Sudip Mukherjee [this message]

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=20140901114935.GA8617@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --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.