Re: [mmotm:master 149/256] mm/memory-failure.c:1587:33: error: passing argument 2 of 'migrate_pages' from incompatible pointer type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri 05-01-18 10:51:40, Wu Fengguang wrote:
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   1ceb98996d2504dd4e0bcb5f4cb9009a18cd8aaa
> commit: c714f7da3636f838c8ed46c7c477525c2ea98a0f [149/256] mm, migrate: remove reason argument from new_page_t
> config: i386-randconfig-i1-201800 (attached as .config)
> compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
> reproduce:
>         git checkout c714f7da3636f838c8ed46c7c477525c2ea98a0f
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
>    mm/memory-failure.c: In function 'soft_offline_huge_page':
> >> mm/memory-failure.c:1587:33: error: passing argument 2 of 'migrate_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
>      ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
>                                     ^~~~~~~~
>    In file included from mm/memory-failure.c:51:0:
>    include/linux/migrate.h:68:12: note: expected 'struct page * (*)(struct page *, long unsigned int)' but argument is of type 'struct page * (*)(struct page *, long unsigned int,  int **)'
>     extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
>                ^~~~~~~~~~~~~
>    mm/memory-failure.c: In function '__soft_offline_page':
>    mm/memory-failure.c:1665:34: error: passing argument 2 of 'migrate_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
>       ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
>                                      ^~~~~~~~
>    In file included from mm/memory-failure.c:51:0:
>    include/linux/migrate.h:68:12: note: expected 'struct page * (*)(struct page *, long unsigned int)' but argument is of type 'struct page * (*)(struct page *, long unsigned int,  int **)'
>     extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
>                ^~~~~~~~~~~~~
>    cc1: some warnings being treated as errors

Sorry about missing this one. I am wondering none of my configs has
CONFIG_MEMORY_FAILURE enabled... I've fixed that. Anyway, the fix is
trivial. Andrew, could you fold it to mm-migrate-remove-reason-argument-from-new_page_t.patch
---
>From e54b09729a2b99f86f0a260e0096047d7f48d28d Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@xxxxxxxx>
Date: Fri, 5 Jan 2018 09:49:58 +0100
Subject: [PATCH] mm, memory-failure: fix migration callback

kbuild robot has noticed
>> mm/memory-failure.c:1587:33: error: passing argument 2 of 'migrate_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
     ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
                                    ^~~~~~~~
   In file included from mm/memory-failure.c:51:0:
   include/linux/migrate.h:68:12: note: expected 'struct page * (*)(struct page *, long unsigned int)' but argument is of type 'struct page * (*)(struct page *, long unsigned int,  int **)'
    extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
               ^~~~~~~~~~~~~
   mm/memory-failure.c: In function '__soft_offline_page':
   mm/memory-failure.c:1665:34: error: passing argument 2 of 'migrate_pages' from incompatible pointer type [-Werror=incompatible-pointer-types]
      ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL,
                                     ^~~~~~~~
   In file included from mm/memory-failure.c:51:0:
   include/linux/migrate.h:68:12: note: expected 'struct page * (*)(struct page *, long unsigned int)' but argument is of type 'struct page * (*)(struct page *, long unsigned int,  int **)'
    extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
               ^~~~~~~~~~~~~

Fix this by removing the excessive argument.

Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
---
 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 4acdf393a801..d530ac1db680 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1483,7 +1483,7 @@ int unpoison_memory(unsigned long pfn)
 }
 EXPORT_SYMBOL(unpoison_memory);
 
-static struct page *new_page(struct page *p, unsigned long private, int **x)
+static struct page *new_page(struct page *p, unsigned long private)
 {
 	int nid = page_to_nid(p);
 
-- 
2.15.1

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux