mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Andrew Morton" <akpm@linux-foundation.org>,
	"Jérôme Glisse" <jglisse@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Michal Hocko <mhocko@suse.com>,
	Mike Rapoport <rppt@linux.vnet.ibm.com>,
	David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] mm/mmu_notifier: fix mmu_notifier_range_init warning
Date: Tue, 11 Dec 2018 21:04:43 +0100	[thread overview]
Message-ID: <20181211200526.3868586-1-arnd@arndb.de> (raw)

The macro version of mmu_notifier_range_init() for CONFIG_MMU_NOTIFIER=n
does not evaluate all its arguments, leading to a warning in one case:

mm/migrate.c: In function 'migrate_vma_pages':
mm/migrate.c:2711:20: error: unused variable 'mm' [-Werror=unused-variable]
  struct mm_struct *mm = vma->vm_mm;

Pass down the 'mm' as into the inline function as well so gcc can
see why the variable exists.

Fixes: 137d92bd73b1 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/mmu_notifier.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 29f7b9670ba3..b13ea00ded5d 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -476,6 +476,7 @@ struct mmu_notifier_range {
 };
 
 static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
+					    struct mm_struct *mm,
 					    unsigned long start,
 					    unsigned long end)
 {
@@ -484,7 +485,7 @@ static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
 }
 
 #define mmu_notifier_range_init(range, mm, start, end, event) \
-	_mmu_notifier_range_init(range, start, end)
+	_mmu_notifier_range_init(range, mm, start, end)
 
 
 static inline int mm_has_notifiers(struct mm_struct *mm)
-- 
2.20.0


             reply	other threads:[~2018-12-11 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 20:04 Arnd Bergmann [this message]
2018-12-11 20:19 ` Jerome Glisse
2018-12-11 21:12   ` David Rientjes
2018-12-11 21:36     ` Jerome Glisse
2018-12-11 21:43       ` David Rientjes
2018-12-11 21:53         ` Arnd Bergmann
2018-12-11 22:19           ` Jerome Glisse
2018-12-11 22:25           ` David Rientjes

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=20181211200526.3868586-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=rppt@linux.vnet.ibm.com \
    --cc=sfr@canb.auug.org.au \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®