On 11/27/2014 11:09 AM, Andrzej Pietrasiewicz wrote:
> Hi Sebastian,

Hi Andrzej,

>> +struct usb_descriptor_header *usb_get_cdesc(struct
>> usb_descriptor_header **hdr,
>> +                         struct usb_descriptor_header *desc,
>> +                         struct usb_descriptor_header **c)
>> +{
>> +    unsigned off;
>> +
>> +    for (off = 0; hdr[off] && c[off]; off++) {
>> +        if (hdr[off] == desc)
>> +            break;
>> +    }
>> +    if (!hdr[off] || !c[off])
>> +        return NULL;
>> +    return c[off];
>> +}
>> +EXPORT_SYMBOL_GPL(usb_get_cdesc);
>> +
> 
> If usb_get_cdesc() is newly added _and_ EXPORTed, it is intended for
> use by other modules, and if that is the case, the other modules should
> probably be able to see its prototype for compilation, shouldn't they?

This is correct, the header is missing. However this is RFC and meant
to talk about it and to apply as-is. I pointed out a problem and two
possible solutions. One would a global mutex and making sure the
gadgets "reverts" critical members of the descriptor to its initial
state if required. The way would be to copy the descriptors (before
touching them) and "taking" the appropriate copy of the descriptor
using this function.

> 
> AP

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to