lkml.org 
[lkml]   [2021]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: cdnsp: Fixes incorrect value in ISOC TRB
On Sat, Mar 06, 2021 at 08:53:42AM +0800, Peter Chen wrote:
> On 21-03-05 06:10:59, Pawel Laszczak wrote:
> > From: Pawel Laszczak <pawell@cadence.com>
> >
> > The value "start_cycle ? 0 : 1" in assignment caused
> > implicit truncation whole value to 1 byte.
> > To fix the issue, an explicit casting has been added.
>
> The root cause for this issue should be operator "|" priority higher
> than "? :", I think just add () for start_cycle ? 0 : 1 could fix it.
> Please double confirm it, and change the commit log if necessary

Please do not rely on this type of thing to get the code right. Spell
it out with real if () statements so that humans can read it and
understand it and maintain it for the next 10+ years.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-03-06 09:21    [W:0.064 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site