Re: [PATCH] USB: misplaced parenthesis

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

 



On Mon, 2010-02-15 at 23:40 +0100, Roel Kluin wrote:
> The parenthesis was misplaced
> 
> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
> ---
> Is this maybe, as the comment states, why blanking a cdrw at speed 4
> was unreliable?
> 
> diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
> index b62a288..b958db5 100644
> --- a/drivers/usb/storage/shuttle_usbat.c
> +++ b/drivers/usb/storage/shuttle_usbat.c
> @@ -1645,8 +1645,8 @@ static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us)
>  
>  	if ((result = usbat_write_block(us,
>  			USBAT_ATA, srb->cmnd, 12,
> -				(srb->cmnd[0]==GPCMD_BLANK ? 75 : 10), 0) !=
> -			     USB_STOR_TRANSPORT_GOOD)) {
> +				(srb->cmnd[0]==GPCMD_BLANK ? 75 : 10), 0)) !=
> +			     USB_STOR_TRANSPORT_GOOD) {
>  		return result;
>  	}

I think it'd be better if you hoisted the set'n'test out of the if()

Isn't this the current logic?

	result = usbat_write_block(us, USBAT_ATA, srb->cmnd, 12,
				   srb->cmnd[0] == GPCMD_BLANK ? 75 : 10, 0);
	result = result != USB_STOR_TRANSPORT_GOOD;
	if (result)
		return result;

I wonder if it should be:

	result = usbat_write_block(us, USBAT_ATA, srb->cmnd, 12,
				   srb->cmnd[0] == GPCMD_BLANK ? 75 : 10, 0);
	if (result != USB_STOR_TRANSPORT_GOOD)
		return result;


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux