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


Groups > linux.kernel > #1639044

Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types

From Guenter Roeck <groeck@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types
Date 2017-05-10 21:20 +0200
Message-ID <tFFjr-4By-7@gated-at.bofh.it> (permalink)
References <tFrzQ-4b3-17@gated-at.bofh.it> <tFBIS-2p1-17@gated-at.bofh.it> <tFDrj-3t7-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 10, 2017 at 10:15 AM, Guru Das S <gurooodas@gmail.com> wrote:
> On 10 May 2017 at 08:23, Guenter Roeck <groeck@google.com> wrote:
>
>> Please the patch into two parts, one per file; the required changes
>> for endianness support in tcpci.c are much more complex.
>
> I will send out a patch for the two simple fixes - the use of
> pd_header_cnt_le().
>
>> Excellent catch, but the fix is wrong. We don't want to change the
>> endianness here, since the data is sent to the chip. This will require
>> a (much) more comprehensive fix - header should probably be le16, the
>> second parameter to tcpci_write16() needs to be le16, plus everything
>> that comes with it (currently the code is just not endianness clean).
>> tcpci_read16() is also incorrect and has the same problem (it is
>> really a bad idea to read 16 bit into an unsigned int pointer).
>>
>> Let me know if you want to try to fix this; otherwise I'll do it.
>
> Sure, I'd like to give this a try. I will take a closer look at the
> code and get back to you with questions.

Thanks!
Guenter

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


Thread

[PATCH] staging: typec: Fix sparse warnings about incorrect types Guru Das Srinagesh <gurooodas@gmail.com> - 2017-05-10 06:40 +0200
  Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types Guenter Roeck <groeck@google.com> - 2017-05-10 17:30 +0200
    Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types Guru Das S <gurooodas@gmail.com> - 2017-05-10 19:20 +0200
      Re: [PATCH] staging: typec: Fix sparse warnings about incorrect types Guenter Roeck <groeck@google.com> - 2017-05-10 21:20 +0200

csiph-web