linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@Oracle.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	SeongJae Park <sj@kernel.org>
Subject: [PATCH mm-unstable 1/1] include/linux/mm: declare different type of split_vma() for !CONFIG_MMU
Date: Fri,  6 Jan 2023 17:18:57 +0000	[thread overview]
Message-ID: <20230106171857.149918-1-sj@kernel.org> (raw)

Commit 95000286ff79 ("mm: switch vma_merge(), split_vma(), and
__split_vma to vma iterator") on mm-unstable didn't make the change to
nommu.c, but the declaration change was applied to !CONFIG_MMU, too.  It
causes below build failure.

    linux/mm/nommu.c:1347:5: error: conflicting types for 'split_vma'
     1347 | int split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
          |     ^~~~~~~~~
    In file included from linux/mm/nommu.c:20:
    linux/include/linux/mm.h:2846:12: note: previous declaration of 'split_vma' was here
     2846 | extern int split_vma(struct vma_iterator *vmi, struct vm_area_struct *,
          |            ^~~~~~~~~

Fix the build failure by adding the split_vma() declaration for
!CONFIG_MMU case.

Fixes: 95000286ff79 ("mm: switch vma_merge(), split_vma(), and __split_vma to vma iterator") on mm-unstabl
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 include/linux/mm.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4d9148b939f8..a2bf261cdbef 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2843,8 +2843,13 @@ extern struct vm_area_struct *vma_merge(struct vma_iterator *vmi,
 extern struct anon_vma *find_mergeable_anon_vma(struct vm_area_struct *);
 extern int __split_vma(struct vma_iterator *vmi, struct vm_area_struct *,
 		       unsigned long addr, int new_below);
+#ifdef CONFIG_MMU
 extern int split_vma(struct vma_iterator *vmi, struct vm_area_struct *,
 			 unsigned long addr, int new_below);
+#else
+extern int split_vma(struct mm_struct *, struct vm_area_struct *,
+			 unsigned long addr, int new_below);
+#endif	/* CONFIG_MMU */
 extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *);
 extern void unlink_file_vma(struct vm_area_struct *);
 extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
-- 
2.25.1



                 reply	other threads:[~2023-01-06 17:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230106171857.149918-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=Liam.Howlett@Oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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;
as well as URLs for NNTP newsgroup(s).