From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Colin Ian King <colin.king@canonical.com>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][mtd-next] mtd: nand: remove redundant check of len
Date: Wed, 13 Dec 2017 20:47:38 +0000 [thread overview]
Message-ID: <20171213214738.7ce39659@bbrezillon> (raw)
In-Reply-To: <e1038c1c-df3e-5a50-9332-616fdba6d165@canonical.com>
On Wed, 13 Dec 2017 20:44:45 +0000
Colin Ian King <colin.king@canonical.com> wrote:
> On 13/12/17 20:38, Boris Brezillon wrote:
> > On Wed, 13 Dec 2017 20:30:04 +0000
> > Colin Ian King <colin.king@canonical.com> wrote:
> >
> >> On 13/12/17 20:24, Boris Brezillon wrote:
> >>> On Wed, 13 Dec 2017 20:17:43 +0000
> >>> Colin King <colin.king@canonical.com> wrote:
> >>>
> >>>> From: Colin Ian King <colin.king@canonical.com>
> >>>>
> >>>> The check of len being zero is redundant as it has already been
> >>>> sanity checked for this value at the start of the function. Hence
> >>>> it is impossible for this test to be true and so the redundant
> >>>> code can be removed.
> >>>
> >>> Nope, it's not the same test, the initial test is
> >>>
> >>> if (len && !buf)
> >>
> >> Ah, the current tip from linux-next has:
> >>
> >> 1912 if (!len || !buf)
> >> 1913 return -EINVAL;
> >>
> >> ..so I guess that's why it got picked up by static analysis.
> >
> > Hm, that's weird, that's not what I see [1] in linux-next.
>
> I see my mistake, I fixed the *wrong* function, I'll send a v2. Doh.
Yep, just noticed that too. No need to send a patch though.
WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Colin Ian King <colin.king@canonical.com>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
linux-mtd@lists.infradead.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH][mtd-next] mtd: nand: remove redundant check of len
Date: Wed, 13 Dec 2017 21:47:38 +0100 [thread overview]
Message-ID: <20171213214738.7ce39659@bbrezillon> (raw)
In-Reply-To: <e1038c1c-df3e-5a50-9332-616fdba6d165@canonical.com>
On Wed, 13 Dec 2017 20:44:45 +0000
Colin Ian King <colin.king@canonical.com> wrote:
> On 13/12/17 20:38, Boris Brezillon wrote:
> > On Wed, 13 Dec 2017 20:30:04 +0000
> > Colin Ian King <colin.king@canonical.com> wrote:
> >
> >> On 13/12/17 20:24, Boris Brezillon wrote:
> >>> On Wed, 13 Dec 2017 20:17:43 +0000
> >>> Colin King <colin.king@canonical.com> wrote:
> >>>
> >>>> From: Colin Ian King <colin.king@canonical.com>
> >>>>
> >>>> The check of len being zero is redundant as it has already been
> >>>> sanity checked for this value at the start of the function. Hence
> >>>> it is impossible for this test to be true and so the redundant
> >>>> code can be removed.
> >>>
> >>> Nope, it's not the same test, the initial test is
> >>>
> >>> if (len && !buf)
> >>
> >> Ah, the current tip from linux-next has:
> >>
> >> 1912 if (!len || !buf)
> >> 1913 return -EINVAL;
> >>
> >> ..so I guess that's why it got picked up by static analysis.
> >
> > Hm, that's weird, that's not what I see [1] in linux-next.
>
> I see my mistake, I fixed the *wrong* function, I'll send a v2. Doh.
Yep, just noticed that too. No need to send a patch though.
next prev parent reply other threads:[~2017-12-13 20:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 20:17 [PATCH][mtd-next] mtd: nand: remove redundant check of len Colin King
2017-12-13 20:24 ` Boris Brezillon
2017-12-13 20:24 ` Boris Brezillon
2017-12-13 20:30 ` Colin Ian King
2017-12-13 20:38 ` Boris Brezillon
2017-12-13 20:38 ` Boris Brezillon
2017-12-13 20:44 ` Colin Ian King
2017-12-13 20:47 ` Boris Brezillon [this message]
2017-12-13 20:47 ` Boris Brezillon
2017-12-13 20:46 ` Boris Brezillon
2017-12-13 20:46 ` Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171213214738.7ce39659@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=colin.king@canonical.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.