Re: [PATCH] USB: misplaced parenthesis

From: Joe Perches
Date: Mon Feb 15 2010 - 17:44:17 EST


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-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/