Re: [PATCH 10/10] Staging: rts5139: rts51x_scsi: fix coding style issues

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

 



On Tue, May 29, 2012 at 01:02:54PM +0100, Adnan Ali wrote:
> This commit fixes coding style issue including
> deprecated min().
> 

If this is patch 10/10, where are the other patches?  The subject
should say something about min_t() or min() or something.  You're
sending these things as fast as you write them and you're doing it
in a sloppy way.  Please slow down.

I said this already.

> Signed-off-by: Adnan Ali <adnan.ali@xxxxxxxxxxxxxxx>
> ---
> @@ -1027,7 +1027,7 @@ static int read_mem(struct scsi_cmnd *srb, struct rts51x_chip *chip)
>  		}
>  	}
>  
> -	len = (unsigned short)min(scsi_bufflen(srb), (unsigned int)len);
> +	len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), len);
              ^^^^^^^^^^^^^^^^
This cast isn't needed.  If len weren't already a short, I would
worry why it is truncating the significant bits away.

>  	rts51x_set_xfer_buf(buf, len, srb);
>  	scsi_set_resid(srb, scsi_bufflen(srb) - len);
>  
> @@ -1054,7 +1054,7 @@ static int write_mem(struct scsi_cmnd *srb, struct rts51x_chip *chip)
>  		return TRANSPORT_GOOD;
>  	}
>  
> -	len = (unsigned short)min(scsi_bufflen(srb), (unsigned int)len);
> +	len = (unsigned short)min_t(unsigned int, scsi_bufflen(srb), len);
              ^^^^^^^^^^^^^^^^
Not needed.

>  	buf = vmalloc(len);
>  	if (!buf)
>  		TRACE_RET(chip, TRANSPORT_ERROR);

regards,
dan carpenter

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