Re: [PATCH v2] usb: musb: gadget: Fix big-endian arch issue

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

 



On Fri, Aug 3, 2018 at 12:03 PM, Alexey Spirkov <AlexeiS@xxxxxxxxxxxx> wrote:
> Existing code is not applicable to big-endian machines
> ctrlrequest fields received in USB endian - i.e. in little-endian
> and should be converted to cpu endianness before usage.

> -               epnum = (u8) ctrlrequest->wIndex;
> +               epnum = (u8) le16_to_cpu(ctrlrequest->wIndex);

> +       u16 reqval = le16_to_cpu(ctrlrequest->wValue);
> +       u16 reqidx = le16_to_cpu(ctrlrequest->wIndex);

I'm wondering, if you run make with C=1 CF=-D__CHECK_ENDIAN__ before
and after your change.


-- 
With Best Regards,
Andy Shevchenko
--
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