From caeed2edaa41b3c15846f6a4babe5ee48f35e01a Mon Sep 17 00:00:00 2001 From: "Z. Liu" Date: Mon, 27 Jul 2026 11:33:23 +0800 Subject: [PATCH] sys-process/atop: fix build error when CONFIG_OBJTOOL_WERROR=y Update the existing netatop patch to replace the deprecated init_module() and cleanup_module() entry points with the module_init() and module_exit() macros. Closes: https://bugs.gentoo.org/959282 Signed-off-by: Z. Liu Part-of: https://codeberg.org/gentoo/gentoo/pulls/1547 Merges: https://codeberg.org/gentoo/gentoo/pulls/1547 Signed-off-by: Sam James --- .../netatop-3.2.2-strict-prototype.patch | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch index 3cb1d6fc50402..65a6a7c59ed37 100644 --- a/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch +++ b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch @@ -1,9 +1,14 @@ Fix for strict prototypes error: declarations are fine, definitions are missing void https://bugs.gentoo.org/949835 ---- a/netatop.c 2024-06-01 15:19:08.000000000 +0400 -+++ b/netatop.c 2025-02-16 15:48:07.094848633 +0400 -@@ -1053,7 +1053,7 @@ + +Replace the deprecated init_module() and cleanup_module() entry points +with the module_init() and module_exit() macros. +https://bugs.gentoo.org/959282 +diff --git a/netatop.c b/netatop.c +--- a/netatop.c ++++ b/netatop.c +@@ -1053,7 +1053,7 @@ garbage_collector(void) ** can be found at the head */ static void @@ -12,7 +17,7 @@ https://bugs.gentoo.org/949835 { unsigned long flags; struct taskinfo *tip; -@@ -1087,7 +1087,7 @@ +@@ -1087,7 +1087,7 @@ gctaskexit() ** cleanup sockinfo structures that are connected to finished processes */ static void @@ -21,7 +26,7 @@ https://bugs.gentoo.org/949835 { int i; struct sockinfo *sip, *sipsave; -@@ -1300,7 +1300,7 @@ +@@ -1300,7 +1300,7 @@ gcsockinfo() ** remove taskinfo structures of finished tasks from hash list */ static void @@ -30,7 +35,7 @@ https://bugs.gentoo.org/949835 { int i; struct taskinfo *tip, *tipsave; -@@ -1376,7 +1376,7 @@ +@@ -1376,7 +1376,7 @@ gctaskinfo() ** remove all sockinfo structs */ static void @@ -39,7 +44,7 @@ https://bugs.gentoo.org/949835 { struct sockinfo *sip, *sipsave; int i; -@@ -1404,7 +1404,7 @@ +@@ -1404,7 +1404,7 @@ wipesockinfo() ** remove all taskinfo structs from hash list */ static void @@ -48,7 +53,7 @@ https://bugs.gentoo.org/949835 { struct taskinfo *tip, *tipsave; int i; -@@ -1432,7 +1432,7 @@ +@@ -1432,7 +1432,7 @@ wipetaskinfo() ** remove all taskinfo structs from exit list */ static void @@ -57,21 +62,32 @@ https://bugs.gentoo.org/949835 { gctaskexit(); } -@@ -1768,7 +1768,7 @@ +@@ -1767,8 +1767,8 @@ static struct pernet_operations netatop_net_ops = { + /* ** called when module loaded */ - int +-int -init_module() -+init_module(void) ++static int __init ++netatop_init(void) { int i; -@@ -1869,7 +1869,7 @@ +@@ -1868,8 +1868,8 @@ init_module() + /* ** called when module unloaded */ - void +-void -cleanup_module() -+cleanup_module(void) ++static void __exit ++netatop_exit(void) { /* ** tell kernel daemon to stop +@@ -1903,3 +1903,6 @@ cleanup_module() + kmem_cache_destroy(ticache); + kmem_cache_destroy(sicache); + } ++ ++module_init(netatop_init) ++module_exit(netatop_exit)