lkml.org 
[lkml]   [2019]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] thunderbolt: Make priority unsigned in struct tb_path
On Wed, Apr 24, 2019 at 12:00:05PM -0700, Nathan Chancellor wrote:
> On Wed, Apr 24, 2019 at 11:49:37AM -0700, Nick Desaulniers wrote:
> > On Wed, Apr 24, 2019 at 11:34 AM Nathan Chancellor
> > <natechancellor@gmail.com> wrote:
> > >
> > > Clang warns:
> > >
> > > drivers/thunderbolt/tunnel.c:504:17: warning: implicit truncation from
> > > 'int' to bit-field changes value from 5 to -3
> > > [-Wbitfield-constant-conversion]
> > > path->priority = 5;
> > > ^ ~
> > > 1 warning generated.
> > >
> > > The priority member in struct tb_path is only ever assigned a positive
> > > number:
> > >
> > > $ rg -n priority drivers/thunderbolt/path.c
> > > drivers/thunderbolt/tunnel.c:99: path->priority = 3;
> > > drivers/thunderbolt/tunnel.c:308: path->priority = 2;
> > > drivers/thunderbolt/tunnel.c:323: path->priority = 1;
> > > drivers/thunderbolt/tunnel.c:504: path->priority = 5;
> >
> > LGTM. Looks like drivers/thunderbolt/tb_regs.h also defines it as u32
> > (no change needed here).
> > Triple checking it's uses, looks like it gets assigned:
> > drivers/thunderbolt/path.c#L492:
> > hop.priority = path->priority;
> > hop is an instance of a struct tb_regs_hop, which is the definition I
> > was looking at above. LGTM thanks Nathan!
> > Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
>
> Thanks for the review!
>
> >
> > >
> > > Furthmore, that value is only assigned to an unsigned integer in
>
> Although apparently I can't spell... should be "Furthermore".

Fixed the typo and applied to thunderbolt.git/next, thanks!

\
 
 \ /
  Last update: 2019-04-25 11:25    [W:0.045 / U:0.224 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site