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

H Hartley Sweeten hartleys at visionengravers.com
Wed Jan 2 18:11:51 UTC 2013


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 at visionengravers.com>
>> Cc: Ian Abbott <abbobbi at mev.co.uk>
>> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
>> ---
>>   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




More information about the devel mailing list