mm/zsmalloc: fix -Wunneeded-internal-declaration warning
Subsystems (2)
PATCH 1/1 mm/zsmalloc: fix -Wunneeded-internal-declaration warning
is_first_page() is only called from the macro VM_BUG_ON_PAGE() which is only compiled in as a runtime check when CONFIG_DEBUG_VM is set, otherwise is checked at compile time and not actually compiled in.
Fixes the following warning, found with Clang:
mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static int is_first_page(struct page *page)
^
--- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/zsmalloc.c +1 -1
@@ -469,7 +469,7 @@ static bool is_zspage_isolated(struct zspage *zspage)return zspage->isolated; } -static int is_first_page (struct page *page) +static __maybe_unused int is_first_page (struct page *page) {return PagePrivate (page); }
Signature · 7 lines
2.11.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Nick Desaulniers
is_first_page()is only called from the macroVM_BUG_ON_PAGE()which is only compiled in as a runtime check whenCONFIG_DEBUG_VMis set, otherwise is checked at compile time and not actually compiled in.
Quoted 8 lines
Fixes the following warning, found with Clang:
mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static intis_first_page(struct page *page)^Signed-off-by Nick Desaulniers <[email protected]>
well, no objections from my side. MM seems to be getting more and more `__maybe_unused' annotations because of clang.
-ss
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Sergey Senozhatsky
Quoted 1 line · Nick Desaulniers
Fixes the following warning, found with Clang:
well, no objections from my side. MM seems to be getting more and more `__maybe_unused' annotations because of clang.
Indeed, but does find bugs when this warning pops up unexpected (unlike in this particular instance). See:
https://patchwork.kernel.org/patch/9738897/
https://www.spinics.net/lists/intel-gfx/msg128737.html
TL;DR
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
You have actually uncovered a bug here where the call is not supposed to be optional in the first place.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Nick Desaulniers
is_first_page()is only called from the macroVM_BUG_ON_PAGE()which is only compiled in as a runtime check whenCONFIG_DEBUG_VMis set, otherwise is checked at compile time and not actually compiled in.
Quoted 8 lines
Fixes the following warning, found with Clang:
mm/zsmalloc.c:472:12: warning: function 'is_first_page' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static intis_first_page(struct page *page)^Signed-off-by Nick Desaulniers <[email protected]>
Thanks.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>