Skip to contentSkip to conversation

PM: hibernate: Remove unused stub for saveable_highmem_page()

PATCH Applied Andy Shevchenko 2 participants 2 messages Sep 5, 2024 – Sep 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: hibernate: Remove unused stub for saveable_highmem_page()

When saveable_highmem_page() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:

kernel/power/snapshot.c:1369:21: error: unused function 'saveable_highmem_page' [-Werror,-Wunused-function]
1369 | static inline void *saveable_highmem_page(struct zone *z, unsigned long p)

      |                     ^~~~~~~~~~~~~~~~~~~~~

Fix this by removing unused stub.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

---
 kernel/power/snapshot.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/power/snapshot.c +0 -5
index 405eddbda4fc..30894d8f0a78 100644
@@ -1365,11 +1365,6 @@ static unsigned int count_highmem_pages(void)
 	}
 	return n;
 }
-#else
-static inline void *saveable_highmem_page(struct zone *z, unsigned long p)
-{
-	return NULL;
-}
 #endif /* CONFIG_HIGHMEM */
 
 /**
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
maintainer Applied
#1 lore raw
Quoted 25 lines · Andy Shevchenko

When saveable_highmem_page() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:

kernel/power/snapshot.c:1369:21: error: unused function 'saveable_highmem_page' [-Werror,-Wunused-function]
1369 | static inline void *saveable_highmem_page(struct zone *z, unsigned long p)

      |                     ^~~~~~~~~~~~~~~~~~~~~

Fix this by removing unused stub.

See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").

---
 kernel/power/snapshot.c | 5 -----
 1 file changed, 5 deletions(-)
kernel/power/snapshot.c +0 -0
index 405eddbda4fc..30894d8f0a78 100644
@@ -1365,11 +1365,6 @@ static unsigned int count_highmem_pages(void)
        }
        return n;

kernel/power/snapshot.c static unsigned int count_highmem_pages(void)

Quoted 10 lines
kernel/power/snapshot.c +0 -6
 }
-#else
-static inline void *saveable_highmem_page(struct zone *z, unsigned long p)
-{
-       return NULL;
-}
 #endif /* CONFIG_HIGHMEM */
 
 /**
--

Applied as 6.12 material, thanks!