lkml.org 
[lkml]   [2017]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: fs/jffs2/readinode.c:189: faulty logic ?
David,

On Tue, Jan 24, 2017 at 9:15 AM, David Binderman <dcb314@hotmail.com> wrote:
> Hello there,
>
> fs/jffs2/readinode.c:189]: (style) Condition 'tn.fn.ofs>=offset' is always true

What tool produces this info?

> Source code is
>
> if (tn->fn->ofs < offset)
> next = tn->rb.rb_right;
> else if (tn->fn->ofs >= offset)
> next = tn->rb.rb_left;
> else
> break;
>
> Maybe better code
>
> if (tn->fn->ofs < offset)
> next = tn->rb.rb_right;
> else if (tn->fn->ofs > offset)
> next = tn->rb.rb_left;
> else
> break;

That code is odd, yes. But we need more info.
Why is fn.fn.ofs>=offset always true?
AFAICT tn->fn->ofs > offset can be also true but
else break is never reached.

--
Thanks,
//richard

\
 
 \ /
  Last update: 2017-01-24 23:21    [W:0.104 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site