Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455956

Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm)

From Guenter Roeck <groeck@google.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm)
Date 2016-08-03 20:50 +0200
Message-ID <s29oS-6hy-21@gated-at.bofh.it> (permalink)
References <s1ODL-16D-3@gated-at.bofh.it> <s1ODM-16D-23@gated-at.bofh.it> <s20OB-LF-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 3, 2016 at 2:28 AM, Oliver Neukum <oneukum@suse.com> wrote:
> On Tue, 2016-08-02 at 13:32 -0700, Guenter Roeck wrote:
>> +static bool svdm_consume_svids(struct tcpm_port *port, const u32
>> *payload,
>> +                              int cnt)
>> +{
>> +       struct pd_mode_data *pmdata = &port->mode_data;
>> +       int i;
>> +
>> +       for (i = 1; i < cnt; i++) {
>> +               u16 svid;
>> +
>> +               svid = (payload[i] >> 16) & 0xffff;
>> +               if (!svid)
>> +                       return false;
>
> Hi,
>
> this looks like an endianness bug.
>

Yes, you are right, and there are lots of those in my code. Thanks for
bringing it up.

Guenter

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/4] Type-C Port Manager Guenter Roeck <groeck@chromium.org> - 2016-08-02 22:40 +0200
  [RFC PATCH 4/4] usb: typec: Type-C Port Controller Interface driver (tcpci) Guenter Roeck <groeck@chromium.org> - 2016-08-02 22:40 +0200
  Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm) Oliver Neukum <oneukum@suse.com> - 2016-08-03 11:30 +0200
    Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm) Guenter Roeck <groeck@google.com> - 2016-08-03 20:10 +0200
  Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm) Oliver Neukum <oneukum@suse.com> - 2016-08-03 11:40 +0200
    Re: [RFC PATCH 3/4] usb: typec: USB Type-C Port Manager (tcpm) Guenter Roeck <groeck@google.com> - 2016-08-03 20:50 +0200

csiph-web