Re: [PATCH 10/10] staging: ks7010: rename return value identifier

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

 



On Tue, Mar 21, 2017 at 01:37:12PM +1100, Tobin C. Harding wrote:
>  static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
>  				    unsigned char *data, unsigned int size)
>  {
> -	int rc;
> +	int ret;
>  	unsigned char *read_buf;
>  
>  	read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
>  	if (!read_buf)
>  		return -ENOMEM;
>  
> -	rc = ks7010_sdio_read(priv, address, read_buf, size);
> -	if (rc)
> +	ret = ks7010_sdio_read(priv, address, read_buf, size);
> +	if (ret)
>  		goto err_free_read_buf;
>  
> -	rc = memcmp(data, read_buf, size);
> -	if (rc) {
> -		DPRINTK(0, "data compare error (%d)\n", rc);
> +	ret = memcmp(data, read_buf, size);
> +	if (ret) {

You didn't introduce this, but this is a bug.  memcpy() doesn't return
error codes.  Could you fix it in a follow on patch?

regards,
dan carpenter
_______________________________________________
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