* [PATCH] mm: mark mm_pgtables_bytes() argument as const
@ 2017-10-18 8:31 Arnd Bergmann
2017-10-18 8:40 ` Kirill A. Shutemov
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-10-18 8:31 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: Arnd Bergmann, Andrew Morton, Michal Hocko, Jan Kara,
Ross Zwisler, Lorenzo Stoakes, linux-mm, linux-kernel
The newly introduced mm_pgtables_bytes() function has two
definitions with slightly different prototypes. The one
used for CONFIG_MMU=n causes a compile-time warning:
In file included from include/linux/kernel.h:13:0,
from mm/debug.c:8:
mm/debug.c: In function 'dump_mm':
mm/debug.c:137:21: error: passing argument 1 of 'mm_pgtables_bytes' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
This changes it to be the same as the other one and avoid the
warning.
Fixes: 7444e6ee9cce ("mm: consolidate page table accounting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/mm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f7db128d2c59..2067dc7d03e7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1677,7 +1677,7 @@ static inline void mm_dec_nr_ptes(struct mm_struct *mm)
#else
static inline void mm_pgtables_bytes_init(struct mm_struct *mm) {}
-static inline unsigned long mm_pgtables_bytes(struct mm_struct *mm)
+static inline unsigned long mm_pgtables_bytes(const struct mm_struct *mm)
{
return 0;
}
--
2.9.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: mark mm_pgtables_bytes() argument as const
2017-10-18 8:31 [PATCH] mm: mark mm_pgtables_bytes() argument as const Arnd Bergmann
@ 2017-10-18 8:40 ` Kirill A. Shutemov
0 siblings, 0 replies; 2+ messages in thread
From: Kirill A. Shutemov @ 2017-10-18 8:40 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Kirill A. Shutemov, Andrew Morton, Michal Hocko, Jan Kara,
Ross Zwisler, Lorenzo Stoakes, linux-mm, linux-kernel
On Wed, Oct 18, 2017 at 10:31:17AM +0200, Arnd Bergmann wrote:
> The newly introduced mm_pgtables_bytes() function has two
> definitions with slightly different prototypes. The one
> used for CONFIG_MMU=n causes a compile-time warning:
>
> In file included from include/linux/kernel.h:13:0,
> from mm/debug.c:8:
> mm/debug.c: In function 'dump_mm':
> mm/debug.c:137:21: error: passing argument 1 of 'mm_pgtables_bytes' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
>
> This changes it to be the same as the other one and avoid the
> warning.
>
> Fixes: 7444e6ee9cce ("mm: consolidate page table accounting")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
The fix is already in mmots:
http://ozlabs.org/~akpm/mmots/broken-out/mm-consolidate-page-table-accounting-fix.patch
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-18 8:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 8:31 [PATCH] mm: mark mm_pgtables_bytes() argument as const Arnd Bergmann
2017-10-18 8:40 ` Kirill A. Shutemov
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).