From a4261cff2ba98de4bb6bfd251092169a7fb4cf28 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Sun, 10 Jun 2012 21:37:16 +0300 Subject: [PATCH] pagemap.h: Do not use hardcoded maximum number of kpageflags The kpageflag definitions are subject to change. It is better to have a dynamic maximum defined for this. Furthermore, the previous maximum was actually wrong. The KSM pages were never shown even if such pages were present on the system. Signed-off-by: Timo Kokkonen --- pagemap.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pagemap.h b/pagemap.h index a8ce444..6d5bbc7 100644 --- a/pagemap.h +++ b/pagemap.h @@ -92,8 +92,6 @@ static inline int swap_offset(struct pageframe *p) return (BITRANGE(5, 54) & p->pf) >> 5; } -#define KPAGEFLAGS_NUM 22 - enum kpageflags { LOCKED, ERROR, @@ -117,8 +115,11 @@ enum kpageflags { HWPOISON, NOPAGE, KSM, + __PAGEFLAGS_LAST, }; +#define KPAGEFLAGS_NUM __PAGEFLAGS_LAST + struct kpageflag_str { int flag; char *str; -- 2.45.0