[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <8d72adf5-097f-0c72-edfc-d23d4199e9d4@gmail.com>
Date: Tue, 24 Jan 2017 15:52:25 +0100
From: Marek Vasut <marek.vasut@...il.com>
To: David Binderman <dcb314@...mail.com>,
"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 ?
On 01/24/2017 09:15 AM, David Binderman wrote:
> Hello there,
>
> fs/jffs2/readinode.c:189]: (style) Condition 'tn.fn.ofs>=offset' is always true
>
> 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;
This changes the logic of the code for equality case, please elaborate
why this is OK.
> Regards
>
> David Binderman
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
--
Best regards,
Marek Vasut
Powered by blists - more mailing lists