lkml.org 
[lkml]   [2017]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][mtd-next] mtd: nand: remove redundant check of len
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.

\
 
 \ /
  Last update: 2017-12-13 21:50    [W:0.030 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site