composite: usb_string_id() doubts

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

 



Hello everyone,

While looking at the usb_string_id() two things stroke me as odd:

#v+
int __init usb_string_id(struct usb_composite_dev *cdev)
{
         if (cdev->next_string_id < 254) {
                 /* string id 0 is reserved */
                 cdev->next_string_id++;
                 return cdev->next_string_id;
         }
         return -ENODEV;
}
#v-

1. The ID 255 will never be assigned.  Is it intended or a bug?

2. 'next_string_id' name is not really appropriate since it does not
    store an ID of a *next* string but *last* sting.  It should rather
    read 'last_string_id', shouldn't it?

I'm also partially because, those changes may be incorporated in my patch
that I submitted earlier today which proposes usb_string_ids_* functions.

--
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
--
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