Re: [PATCH] staging: goldfish_audio.c: sparse warning of incorrect type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux