2019-07-29 03:51:32

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the akpm-current tree

Hi all,

After merging the akpm-current tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

drivers/infiniband/sw/siw/siw_mem.c: In function 'siw_free_plist':
drivers/infiniband/sw/siw/siw_mem.c:66:16: warning: unused variable 'p' [-Wunused-variable]
struct page **p = chunk->plist;
^

Introduced by commit

63630f9a8d72 ("mm/gup: add make_dirty arg to put_user_pages_dirty_lock()")

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-07-29 08:13:23

by John Hubbard

[permalink] [raw]
Subject: [PATCH] mm/gup: remove unused variable in siw_free_plist()

From: John Hubbard <[email protected]>

Commit 63630f9a8d72 ("mm/gup: add make_dirty arg to
put_user_pages_dirty_lock()") removed the only user of the
local variable p. Finish the job by removing p as well.

Fixes: 63630f9a8d72 ("mm/gup: add make_dirty arg to put_user_pages_dirty_lock()")
Signed-off-by: John Hubbard <[email protected]>
---

Hi,

This fixes the warning. Ideally this should be merged with the commit
that it fixes, if that's still possible.

Andrew, would you also like a fixed version of this patch posted
as a new version of the 3-patch set that it came with?

thanks,
John Hubbard
NVIDIA

drivers/infiniband/sw/siw/siw_mem.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c
index 358d440efa11..ab83a9cec562 100644
--- a/drivers/infiniband/sw/siw/siw_mem.c
+++ b/drivers/infiniband/sw/siw/siw_mem.c
@@ -63,8 +63,6 @@ struct siw_mem *siw_mem_id2obj(struct siw_device *sdev, int stag_index)
static void siw_free_plist(struct siw_page_chunk *chunk, int num_pages,
bool dirty)
{
- struct page **p = chunk->plist;
-
put_user_pages_dirty_lock(chunk->plist, num_pages, dirty);
}

--
2.22.0

2019-07-31 07:18:49

by Miles Chen

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

On Wed, 2019-07-31 at 16:11 +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the akpm-current tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
>
> mm/memcontrol.c: In function 'invalidate_reclaim_iterators':
> mm/memcontrol.c:1160:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
> } while (memcg = parent_mem_cgroup(memcg));
> ^~~~~
>

Hi Stephen,

Thanks for the telling me this. Sorry for the build warning.
Should I send patch v5 to the mailing list to fix this?


Miles

> Introduced by commit
>
> c48a2f5ce935 ("mm/memcontrol.c: fix use after free in mem_cgroup_iter()")
>


2019-08-01 06:00:50

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

Hi Miles,

On Wed, 31 Jul 2019 14:28:04 +0800 Miles Chen <[email protected]> wrote:
>
> On Wed, 2019-07-31 at 16:11 +1000, Stephen Rothwell wrote:
> >
> > After merging the akpm-current tree, today's linux-next build (powerpc
> > ppc64_defconfig) produced this warning:
> >
> > mm/memcontrol.c: In function 'invalidate_reclaim_iterators':
> > mm/memcontrol.c:1160:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
> > } while (memcg = parent_mem_cgroup(memcg));
> > ^~~~~
> >
>
> Hi Stephen,
>
> Thanks for the telling me this. Sorry for the build warning.
> Should I send patch v5 to the mailing list to fix this?

You might as well (cc'ing Andrew, of course).

I would suggest finishing that loop like this:

memcg = parent_mem_cgroup(memcg);
} while (memcg);

rather than adding a set of parentheses.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-08-01 06:17:34

by Michal Hocko

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

On Thu 01-08-19 15:51:30, Stephen Rothwell wrote:
> Hi Miles,
>
> On Wed, 31 Jul 2019 14:28:04 +0800 Miles Chen <[email protected]> wrote:
> >
> > On Wed, 2019-07-31 at 16:11 +1000, Stephen Rothwell wrote:
> > >
> > > After merging the akpm-current tree, today's linux-next build (powerpc
> > > ppc64_defconfig) produced this warning:
> > >
> > > mm/memcontrol.c: In function 'invalidate_reclaim_iterators':
> > > mm/memcontrol.c:1160:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
> > > } while (memcg = parent_mem_cgroup(memcg));
> > > ^~~~~
> > >
> >
> > Hi Stephen,
> >
> > Thanks for the telling me this. Sorry for the build warning.
> > Should I send patch v5 to the mailing list to fix this?
>
> You might as well (cc'ing Andrew, of course).
>
> I would suggest finishing that loop like this:
>
> memcg = parent_mem_cgroup(memcg);
> } while (memcg);
>
> rather than adding a set of parentheses.

Qian has already posted a patch http://lkml.kernel.org/r/[email protected]
--
Michal Hocko
SUSE Labs

2019-08-01 06:32:25

by Miles Chen

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

On Thu, 2019-08-01 at 08:15 +0200, Michal Hocko wrote:
> On Thu 01-08-19 15:51:30, Stephen Rothwell wrote:
> > Hi Miles,
> >
> > On Wed, 31 Jul 2019 14:28:04 +0800 Miles Chen <[email protected]> wrote:
> > >
> > > On Wed, 2019-07-31 at 16:11 +1000, Stephen Rothwell wrote:
> > > >
> > > > After merging the akpm-current tree, today's linux-next build (powerpc
> > > > ppc64_defconfig) produced this warning:
> > > >
> > > > mm/memcontrol.c: In function 'invalidate_reclaim_iterators':
> > > > mm/memcontrol.c:1160:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
> > > > } while (memcg = parent_mem_cgroup(memcg));
> > > > ^~~~~
> > > >
> > >
> > > Hi Stephen,
> > >
> > > Thanks for the telling me this. Sorry for the build warning.
> > > Should I send patch v5 to the mailing list to fix this?
> >
> > You might as well (cc'ing Andrew, of course).
> >
> > I would suggest finishing that loop like this:
> >
> > memcg = parent_mem_cgroup(memcg);
> > } while (memcg);
> >
> > rather than adding a set of parentheses.

thanks for the advise
>
> Qian has already posted a patch http://lkml.kernel.org/r/[email protected]

Thanks Qian's quick fix.

It's the first time that I receive a build warning after the patch has
been merged to -mm tree. The build warning had been fixed by Qian,
should I send another change for this?


2019-08-01 06:40:35

by Michal Hocko

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

On Thu 01-08-19 14:30:03, Miles Chen wrote:
[...]
> It's the first time that I receive a build warning after the patch has
> been merged to -mm tree. The build warning had been fixed by Qian,
> should I send another change for this?

No need. Andrew has already picked up the fix for mmotm tree and it
should show up in linux-next soon.

Thanks!
--
Michal Hocko
SUSE Labs

2019-08-01 06:42:38

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

Hi Miles,

On Thu, 1 Aug 2019 14:30:03 +0800 Miles Chen <[email protected]> wrote:
>
> It's the first time that I receive a build warning after the patch has
> been merged to -mm tree. The build warning had been fixed by Qian,
> should I send another change for this?

No, that will do.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-08-01 07:30:36

by Miles Chen

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the akpm-current tree

On Thu, 2019-08-01 at 16:39 +1000, Stephen Rothwell wrote:
> Hi Miles,
>
> On Thu, 1 Aug 2019 14:30:03 +0800 Miles Chen <[email protected]> wrote:
> >
> > It's the first time that I receive a build warning after the patch has
> > been merged to -mm tree. The build warning had been fixed by Qian,
> > should I send another change for this?
>
> No, that will do.

got it. thanks