[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvwJrLR8-5QSfzL3TBk_kwLSUq+DarCB5XWbn+LKiK53dQ@mail.gmail.com>
Date: Tue, 24 Jan 2017 23:20:39 +0100
From: Richard Weinberger <richard.weinberger@...il.com>
To: David Binderman <dcb314@...mail.com>
Cc: "dwmw2@...radead.org" <dwmw2@...radead.org>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: fs/jffs2/readinode.c:189: faulty logic ?
David,
On Tue, Jan 24, 2017 at 9:15 AM, David Binderman <dcb314@...mail.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
Powered by blists - more mailing lists