Re: [RFC 2/6] usb/dummy_hcd: add sg support

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

 



* Alan Stern | 2011-12-08 14:42:51 [-0500]:

>> +static void forward_miter(struct sg_mapping_iter *miter, u32 bytes)
>> +{
>> +	u32 done = 0;
>> +
>> +	/* press the forward button on the URB side */
>> +	if (!bytes)
>> +		return;
>> +	do {
>> +		done += miter->length;
>> +		if (bytes > done) {
>> +			sg_miter_next(miter);
>> +			continue;
>> +		}
>> +		if (bytes == done)
>> +			break;
>> +
>> +		miter->consumed = miter->length - (done - bytes);
>> +		break;
>> +	} while (1);
>> +	sg_miter_next(miter);
>> +}
>
>This entire routine could be eliminated if you put the sg_mapping_iter
>thingy inside the urbp private structure.  Don't start the iteration 
>until you're ready to use it, of course.

Done.

>Alan Stern

Sebastian
--
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