Commit 90b8fab5 authored by David Hildenbrand's avatar David Hildenbrand Committed by Andrew Morton

mm/highmem: make nr_free_highpages() return "unsigned long"

It looks rather weird that totalhigh_pages() returns an "unsigned long"
but nr_free_highpages() returns an "unsigned int".

Let's return an "unsigned long" from nr_free_highpages() to be consistent.

While at it, use a plain "0" instead of a "0UL" in the !CONFIG_HIGHMEM
totalhigh_pages() implementation, to make these look alike as well.

Link: https://lkml.kernel.org/r/20240607083711.62833-3-david@redhat.comSigned-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Reviewed-by: default avatarWei Yang <richard.weiyang@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7a581204
...@@ -131,10 +131,10 @@ static inline void __kunmap_atomic(const void *addr) ...@@ -131,10 +131,10 @@ static inline void __kunmap_atomic(const void *addr)
preempt_enable(); preempt_enable();
} }
unsigned int __nr_free_highpages(void); unsigned long __nr_free_highpages(void);
unsigned long __totalhigh_pages(void); unsigned long __totalhigh_pages(void);
static inline unsigned int nr_free_highpages(void) static inline unsigned long nr_free_highpages(void)
{ {
return __nr_free_highpages(); return __nr_free_highpages();
} }
...@@ -234,8 +234,8 @@ static inline void __kunmap_atomic(const void *addr) ...@@ -234,8 +234,8 @@ static inline void __kunmap_atomic(const void *addr)
preempt_enable(); preempt_enable();
} }
static inline unsigned int nr_free_highpages(void) { return 0; } static inline unsigned long nr_free_highpages(void) { return 0; }
static inline unsigned long totalhigh_pages(void) { return 0UL; } static inline unsigned long totalhigh_pages(void) { return 0; }
static inline bool is_kmap_addr(const void *x) static inline bool is_kmap_addr(const void *x)
{ {
......
...@@ -179,7 +179,7 @@ static inline void *kmap_local_folio(struct folio *folio, size_t offset); ...@@ -179,7 +179,7 @@ static inline void *kmap_local_folio(struct folio *folio, size_t offset);
static inline void *kmap_atomic(struct page *page); static inline void *kmap_atomic(struct page *page);
/* Highmem related interfaces for management code */ /* Highmem related interfaces for management code */
static inline unsigned int nr_free_highpages(void); static inline unsigned long nr_free_highpages(void);
static inline unsigned long totalhigh_pages(void); static inline unsigned long totalhigh_pages(void);
#ifndef ARCH_HAS_FLUSH_ANON_PAGE #ifndef ARCH_HAS_FLUSH_ANON_PAGE
......
...@@ -111,10 +111,10 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color) ...@@ -111,10 +111,10 @@ static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color)
} }
#endif #endif
unsigned int __nr_free_highpages(void) unsigned long __nr_free_highpages(void)
{ {
unsigned long pages = 0;
struct zone *zone; struct zone *zone;
unsigned int pages = 0;
for_each_populated_zone(zone) { for_each_populated_zone(zone) {
if (is_highmem(zone)) if (is_highmem(zone))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment