/* We support strings in multiple languages ... string descriptor zero says which languages are supported. The typical case will be that only one language (probably English) is used, with I18N handled on the host side.  */
static void collect_langs(struct usb_gadget_strings **sp, void *buf)
/* We support strings in multiple languages ... string descriptor zero says which languages are supported. The typical case will be that only one language (probably English) is used, with I18N handled on the host side.  */
static void collect_langs(struct usb_gadget_strings **sp, void *buf)
{
	const struct usb_gadget_strings	*s;
	u16				language;
	__le16_packed			*tmp;
	__le16_packed			*end = (buf + 252);
	while (*sp) {
		s = *sp;
		language = cpu_to_le16(s->language);
		for (tmp = buf; tmp->val && tmp < end; tmp++) {
			if (tmp->val == language)
				goto repeat;
		}
		tmp->val = language;
repeat:
		sp++;
	}
}