Re: pxa2xx_spi: spi_bfin5xx: limit reaches -1 rather than 0

From: roel kluin
Date: Sun Feb 08 2009 - 11:59:23 EST


2009/2/8 David Brownell <david-b@xxxxxxxxxxx>:
> On Sunday 08 February 2009, Roel Kluin wrote:
>> vi drivers/spi/pxa2xx_spi.c +919
>> vi drivers/spi/spi_bfin5xx.c +645
>>
>> if (flush(drv_data) == 0) {
>> dev_err(&drv_data->pdev->dev, "pump_transfers: flush failed\n");
>> message->status = -EIO;
>> giveback(drv_data);
>> return;
>> }
>>
>> But with a postfix decrement limit reaches -1 rather than 0.
>>
>> Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx>
>
> Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

could you please review the patch at http://lkml.org/lkml/2009/2/8/72
instead? I initially overlooked two similar issues in the same file.

> Although, note that if the *actual* count mattered here,
> the correect patch would be to test "flush() < 0)" ...
> except when using a "do {...} while (--limit)" idiom.

True. You can also increase the limit with 1 when changing post- to
prefix for the while (--limit) {...} idiom.
--
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/