* [PATCH 1/3] mm: add include files so that function definitions have a prototype
@ 2018-12-04 5:14 Adeodato Simó
2018-12-04 5:14 ` [PATCH 2/3] mm: move two private functions to static linkage Adeodato Simó
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Adeodato Simó @ 2018-12-04 5:14 UTC (permalink / raw)
To: linux-mm; +Cc: kernel-janitors
Previously, rodata_test(), usercopy_warn(), and usercopy_abort() were
defined without a matching prototype. Detected by -Wmissing-prototypes
GCC flag.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
I started poking at this after kernel-janitors got the suggestion[1]
to look into the -Wmissing-prototypes warnings.
Thanks for considering!
[1]: https://www.spinics.net/lists/linux-kernel-janitors/msg43981.html
mm/rodata_test.c | 1 +
mm/usercopy.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/mm/rodata_test.c b/mm/rodata_test.c
index d908c8769b48..01306defbd1b 100644
--- a/mm/rodata_test.c
+++ b/mm/rodata_test.c
@@ -11,6 +11,7 @@
*/
#define pr_fmt(fmt) "rodata_test: " fmt
+#include <linux/rodata_test.h>
#include <linux/uaccess.h>
#include <asm/sections.h>
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 852eb4e53f06..f487ba4888df 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -20,6 +20,7 @@
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
#include <linux/thread_info.h>
+#include <linux/uaccess.h>
#include <linux/atomic.h>
#include <linux/jump_label.h>
#include <asm/sections.h>
--
2.19.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] mm: move two private functions to static linkage
2018-12-04 5:14 [PATCH 1/3] mm: add include files so that function definitions have a prototype Adeodato Simó
@ 2018-12-04 5:14 ` Adeodato Simó
2018-12-04 7:48 ` Mike Rapoport
2018-12-04 5:14 ` [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h Adeodato Simó
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Adeodato Simó @ 2018-12-04 5:14 UTC (permalink / raw)
To: linux-mm; +Cc: kernel-janitors
follow_page_context() and __thp_get_unmapped_area() have no public
declarations and are only used in the files that define them (mm/gup.c
and mm/huge_memory.c, respectively).
This change also appeases GCC if run with -Wmissing-prototypes.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
mm/gup.c | 6 +++---
mm/huge_memory.c | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/mm/gup.c b/mm/gup.c
index 6dd33e16a806..86a10a9b0344 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -399,9 +399,9 @@ static struct page *follow_p4d_mask(struct vm_area_struct *vma,
* an error pointer if there is a mapping to something not represented
* by a page descriptor (see also vm_normal_page()).
*/
-struct page *follow_page_mask(struct vm_area_struct *vma,
- unsigned long address, unsigned int flags,
- struct follow_page_context *ctx)
+static struct page *follow_page_mask(struct vm_area_struct *vma,
+ unsigned long address, unsigned int flags,
+ struct follow_page_context *ctx)
{
pgd_t *pgd;
struct page *page;
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 2dba2c1c299a..45c1ff36baf1 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -499,8 +499,9 @@ void prep_transhuge_page(struct page *page)
set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
}
-unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
- loff_t off, unsigned long flags, unsigned long size)
+static unsigned long __thp_get_unmapped_area(struct file *filp,
+ unsigned long len, loff_t off, unsigned long flags,
+ unsigned long size)
{
unsigned long addr;
loff_t off_end = off + len;
--
2.19.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h
2018-12-04 5:14 [PATCH 1/3] mm: add include files so that function definitions have a prototype Adeodato Simó
2018-12-04 5:14 ` [PATCH 2/3] mm: move two private functions to static linkage Adeodato Simó
@ 2018-12-04 5:14 ` Adeodato Simó
2018-12-04 7:48 ` Mike Rapoport
2018-12-04 7:47 ` [PATCH 1/3] mm: add include files so that function definitions have a prototype Mike Rapoport
2019-01-17 10:36 ` Adeodato Simó
3 siblings, 1 reply; 7+ messages in thread
From: Adeodato Simó @ 2018-12-04 5:14 UTC (permalink / raw)
To: linux-mm; +Cc: kernel-janitors
This follows-up commit dfb3ccd00a06 ("mm: make memmap_init a proper
function"), which changed memmap_init from macro to function.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
scripts/checkpatch.pl complained about use of extern for a prototype,
but I preferred to maintain consistency with surrounding code. -d
include/linux/mm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3eb3bf7774f1..8597b864dd91 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2268,6 +2268,8 @@ static inline void zero_resv_unavail(void) {}
#endif
extern void set_dma_reserve(unsigned long new_dma_reserve);
+extern void memmap_init(unsigned long size, int nid,
+ unsigned long zone, unsigned long start_pfn);
extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
enum memmap_context, struct vmem_altmap *);
extern void setup_per_zone_wmarks(void);
--
2.19.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] mm: add include files so that function definitions have a prototype
2018-12-04 5:14 [PATCH 1/3] mm: add include files so that function definitions have a prototype Adeodato Simó
2018-12-04 5:14 ` [PATCH 2/3] mm: move two private functions to static linkage Adeodato Simó
2018-12-04 5:14 ` [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h Adeodato Simó
@ 2018-12-04 7:47 ` Mike Rapoport
2019-01-17 10:36 ` Adeodato Simó
3 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2018-12-04 7:47 UTC (permalink / raw)
To: Adeodato Simó; +Cc: linux-mm, kernel-janitors
On Tue, Dec 04, 2018 at 02:14:22AM -0300, Adeodato Sim� wrote:
> Previously, rodata_test(), usercopy_warn(), and usercopy_abort() were
> defined without a matching prototype. Detected by -Wmissing-prototypes
> GCC flag.
>
> Signed-off-by: Adeodato Sim� <dato@net.com.org.es>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> I started poking at this after kernel-janitors got the suggestion[1]
> to look into the -Wmissing-prototypes warnings.
>
> Thanks for considering!
>
> [1]: https://www.spinics.net/lists/linux-kernel-janitors/msg43981.html
>
> mm/rodata_test.c | 1 +
> mm/usercopy.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/mm/rodata_test.c b/mm/rodata_test.c
> index d908c8769b48..01306defbd1b 100644
> --- a/mm/rodata_test.c
> +++ b/mm/rodata_test.c
> @@ -11,6 +11,7 @@
> */
> #define pr_fmt(fmt) "rodata_test: " fmt
>
> +#include <linux/rodata_test.h>
> #include <linux/uaccess.h>
> #include <asm/sections.h>
>
> diff --git a/mm/usercopy.c b/mm/usercopy.c
> index 852eb4e53f06..f487ba4888df 100644
> --- a/mm/usercopy.c
> +++ b/mm/usercopy.c
> @@ -20,6 +20,7 @@
> #include <linux/sched/task.h>
> #include <linux/sched/task_stack.h>
> #include <linux/thread_info.h>
> +#include <linux/uaccess.h>
> #include <linux/atomic.h>
> #include <linux/jump_label.h>
> #include <asm/sections.h>
> --
> 2.19.2
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] mm: move two private functions to static linkage
2018-12-04 5:14 ` [PATCH 2/3] mm: move two private functions to static linkage Adeodato Simó
@ 2018-12-04 7:48 ` Mike Rapoport
0 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2018-12-04 7:48 UTC (permalink / raw)
To: Adeodato Simó; +Cc: linux-mm, kernel-janitors
On Tue, Dec 04, 2018 at 02:14:23AM -0300, Adeodato Sim� wrote:
> follow_page_context() and __thp_get_unmapped_area() have no public
> declarations and are only used in the files that define them (mm/gup.c
> and mm/huge_memory.c, respectively).
>
> This change also appeases GCC if run with -Wmissing-prototypes.
>
> Signed-off-by: Adeodato Sim� <dato@net.com.org.es>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> mm/gup.c | 6 +++---
> mm/huge_memory.c | 5 +++--
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 6dd33e16a806..86a10a9b0344 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -399,9 +399,9 @@ static struct page *follow_p4d_mask(struct vm_area_struct *vma,
> * an error pointer if there is a mapping to something not represented
> * by a page descriptor (see also vm_normal_page()).
> */
> -struct page *follow_page_mask(struct vm_area_struct *vma,
> - unsigned long address, unsigned int flags,
> - struct follow_page_context *ctx)
> +static struct page *follow_page_mask(struct vm_area_struct *vma,
> + unsigned long address, unsigned int flags,
> + struct follow_page_context *ctx)
> {
> pgd_t *pgd;
> struct page *page;
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 2dba2c1c299a..45c1ff36baf1 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -499,8 +499,9 @@ void prep_transhuge_page(struct page *page)
> set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
> }
>
> -unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
> - loff_t off, unsigned long flags, unsigned long size)
> +static unsigned long __thp_get_unmapped_area(struct file *filp,
> + unsigned long len, loff_t off, unsigned long flags,
> + unsigned long size)
> {
> unsigned long addr;
> loff_t off_end = off + len;
> --
> 2.19.2
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h
2018-12-04 5:14 ` [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h Adeodato Simó
@ 2018-12-04 7:48 ` Mike Rapoport
0 siblings, 0 replies; 7+ messages in thread
From: Mike Rapoport @ 2018-12-04 7:48 UTC (permalink / raw)
To: Adeodato Simó; +Cc: linux-mm, kernel-janitors
On Tue, Dec 04, 2018 at 02:14:24AM -0300, Adeodato Sim� wrote:
> This follows-up commit dfb3ccd00a06 ("mm: make memmap_init a proper
> function"), which changed memmap_init from macro to function.
>
> Signed-off-by: Adeodato Sim� <dato@net.com.org.es>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> scripts/checkpatch.pl complained about use of extern for a prototype,
> but I preferred to maintain consistency with surrounding code. -d
>
> include/linux/mm.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 3eb3bf7774f1..8597b864dd91 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2268,6 +2268,8 @@ static inline void zero_resv_unavail(void) {}
> #endif
>
> extern void set_dma_reserve(unsigned long new_dma_reserve);
> +extern void memmap_init(unsigned long size, int nid,
> + unsigned long zone, unsigned long start_pfn);
> extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long,
> enum memmap_context, struct vmem_altmap *);
> extern void setup_per_zone_wmarks(void);
> --
> 2.19.2
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] mm: add include files so that function definitions have a prototype
2018-12-04 5:14 [PATCH 1/3] mm: add include files so that function definitions have a prototype Adeodato Simó
` (2 preceding siblings ...)
2018-12-04 7:47 ` [PATCH 1/3] mm: add include files so that function definitions have a prototype Mike Rapoport
@ 2019-01-17 10:36 ` Adeodato Simó
3 siblings, 0 replies; 7+ messages in thread
From: Adeodato Simó @ 2019-01-17 10:36 UTC (permalink / raw)
To: linux-mm; +Cc: kernel-janitors
Hello,
Any chance these three patches of mine (reviewed by Mike Rapoport)
will get merged?
Thanks for considering,
-d
P.S.: If they already got merged, I apologize—I couldn't find a
repo for mm. (I checked master and next.)
On Tue, Dec 4, 2018 at 02:14 -0300, Adeodato Simó <dato@net.com.org.es> wrote:
> Previously, rodata_test(), usercopy_warn(), and usercopy_abort() were
> defined without a matching prototype. Detected by -Wmissing-prototypes
> GCC flag.
>
> Signed-off-by: Adeodato Simó <dato@net.com.org.es>
> ---
> I started poking at this after kernel-janitors got the suggestion[1]
> to look into the -Wmissing-prototypes warnings.
>
> Thanks for considering!
>
> [1]: https://www.spinics.net/lists/linux-kernel-janitors/msg43981.html
>
> mm/rodata_test.c | 1 +
> mm/usercopy.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/mm/rodata_test.c b/mm/rodata_test.c
> index d908c8769b48..01306defbd1b 100644
> --- a/mm/rodata_test.c
> +++ b/mm/rodata_test.c
> @@ -11,6 +11,7 @@
> */
> #define pr_fmt(fmt) "rodata_test: " fmt
>
> +#include <linux/rodata_test.h>
> #include <linux/uaccess.h>
> #include <asm/sections.h>
>
> diff --git a/mm/usercopy.c b/mm/usercopy.c
> index 852eb4e53f06..f487ba4888df 100644
> --- a/mm/usercopy.c
> +++ b/mm/usercopy.c
> @@ -20,6 +20,7 @@
> #include <linux/sched/task.h>
> #include <linux/sched/task_stack.h>
> #include <linux/thread_info.h>
> +#include <linux/uaccess.h>
> #include <linux/atomic.h>
> #include <linux/jump_label.h>
> #include <asm/sections.h>
> --
> 2.19.2
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-01-17 10:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 5:14 [PATCH 1/3] mm: add include files so that function definitions have a prototype Adeodato Simó
2018-12-04 5:14 ` [PATCH 2/3] mm: move two private functions to static linkage Adeodato Simó
2018-12-04 7:48 ` Mike Rapoport
2018-12-04 5:14 ` [PATCH 3/3] mm: add missing declaration of memmap_init in linux/mm.h Adeodato Simó
2018-12-04 7:48 ` Mike Rapoport
2018-12-04 7:47 ` [PATCH 1/3] mm: add include files so that function definitions have a prototype Mike Rapoport
2019-01-17 10:36 ` Adeodato Simó
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox