RE: [PATCH 10/11] staging: comedi: comedi_buf: clarify __comedi_buf_write_alloc()

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

 



On Wednesday, January 02, 2013 6:55 AM, Ian Abbott wrote:
> On 2012-12-21 16:42, H Hartley Sweeten wrote:
>> Clarify the check to make sure the number of bytes to allocate is
>> available.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
>> Cc: Ian Abbott <abbobbi@xxxxxxxxx>
>> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
>> ---
>>   drivers/staging/comedi/comedi_buf.c | 9 +++------
>>   1 file changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
>> index 1ec5aaa..5be9930 100644
>> --- a/drivers/staging/comedi/comedi_buf.c
>> +++ b/drivers/staging/comedi/comedi_buf.c
>> @@ -182,13 +182,10 @@ static unsigned int __comedi_buf_write_alloc(struct comedi_async *async,
>>   					     int strict)
>>   {
>>   	unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
>> +	int available = free_end - async->buf_write_alloc_count;
>
> Should preferably be unsigned int.

Same concern as in patch 9/11. Will the free_end always be larger, or equal,
to the buf_write_alloc_count?

Regards,
Hartley

_______________________________________________
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