Messages in this thread | | | From | Richard Weinberger <> | Date | Tue, 24 Jan 2017 23:20:39 +0100 | Subject | Re: 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
| |