dibs: Remove reset of static vars in dibs_init()
Subsystems (5)
Alexandra Winter
maintainerPATCH 1/2 dibs: Remove reset of static vars in dibs_init()
'clients' and 'max_client' are static variables and therefore don't need to be initialized.
--- drivers/dibs/dibs_main.c | 3 --- 1 file changed, 3 deletions(-)
drivers/dibs/dibs_main.c +0 -3
@@ -254,9 +254,6 @@ static int __init dibs_init(void) {int rc; -memset (clients,0 ,sizeof (clients)); - max_client =0 ; - dibs_class =class_create ("dibs" );if (IS_ERR (dibs_class))return PTR_ERR (dibs_class);
Signature · 1 line
2.48.1
Alexandra Winter
maintainerPATCH 2/2 dibs: Use subsys_initcall()
In the case of built-in modules, the order of module_init() calls are derived from the Makefiles.
Use subsys_initcall() for the dibs module, to make sure dibs_init() is executed before dibs clients like smc and dibs devices like ism are initialized. So future dibs client or dibs device modules can use module_init() without the risk of getting the order in the Makefiles wrong.
--- drivers/dibs/dibs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dibs/dibs_main.c +1 -1
@@ -271,5 +271,5 @@ static void __exit dibs_exit(void)class_destroy (dibs_class); } -module_init (dibs_init); +subsys_initcall (dibs_init);module_exit (dibs_exit);
Signature · 1 line
2.48.1
Re: [PATCH net-next 2/2] dibs: Use subsys_initcall()
From: Alexandra Winter <[email protected]>
Date: Thu, 23 Oct 2025 17:06:36 +0200
Quoted 9 lines
In the case of built-in modules, the order of
module_init()calls are derived from the Makefiles.Use
subsys_initcall()for the dibs module, to make suredibs_init()is executed before dibs clients like smc and dibs devices like ism are initialized. So future dibs client or dibs device modules can usemodule_init()without the risk of getting the order in the Makefiles wrong.Reported-by Mete Durlu <[email protected]>
Was this reported on LKML, so that you could add a 'Closes:' tag with the link here or the report was internal?
Quoted 1 line
Signed-off-by Alexandra Winter <[email protected]>
Either way,
Quoted 9 lines
--- drivers/dibs/dibs_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/dibs/dibs_main.c +0
-0
drivers/dibs/dibs_main.c static void __exit dibs_exit(void) · line 275
Quoted 6 lines
drivers/dibs/dibs_main.c +1
-1@@ -271,5 +271,5 @@ static void __exit dibs_exit(void)class_destroy (dibs_class); } -module_init (dibs_init); +subsys_initcall (dibs_init);module_exit (dibs_exit);
Thanks,
Olek
Alexandra Winter
maintainerRe: [PATCH net-next 2/2] dibs: Use subsys_initcall()
Quoted 3 lines · Alexander Lobakin
Quoted 1 line
Reported-by Mete Durlu <[email protected]>Was this reported on LKML, so that you could add a 'Closes:' tag with the link here or the report was internal?
It was an internal report, so no link available.
We still want to give credit for the colleague who spent time to report this issue outside of his main area.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Alexandra Winter <[email protected]>Either way,
Reviewed-by Alexander Lobakin <[email protected]>
Thank you very much.
From: Alexandra Winter <[email protected]>
Date: Thu, 23 Oct 2025 17:06:35 +0200
Quoted 5 lines
'clients' and '
max_client' are static variables and therefore don't need to be initialized.Reported-by Mete Durlu <[email protected]>Signed-off-by Alexandra Winter <[email protected]>
Quoted 9 lines
--- drivers/dibs/dibs_main.c | 3 --- 1 file changed, 3 deletions(-)drivers/dibs/dibs_main.c +0
-0
drivers/dibs/dibs_main.c static int __init dibs_init(void) · line 259
Quoted 9 lines
drivers/dibs/dibs_main.c +0
-3@@ -254,9 +254,6 @@ static int __init dibs_init(void) {int rc; -memset (clients,0 ,sizeof (clients)); - max_client =0 ; - dibs_class =class_create ("dibs" );if (IS_ERR (dibs_class))return PTR_ERR (dibs_class);
Thanks,
Olek
Quoted 5 lines · Alexandra Winter
'clients' and '
max_client' are static variables and therefore don't need to be initialized.Reported-by Mete Durlu <[email protected]>Signed-off-by Alexandra Winter <[email protected]>
Best regards,
Dust
Quoted 20 lines
---
drivers/dibs/dibs_main.c| 3 ---1 file changed, 3 deletions(-)drivers/dibs/dibs_main.c +0
-3@@ -254,9 +254,6 @@ static int __init dibs_init(void) {int rc; -memset (clients,0 ,sizeof (clients)); - max_client =0 ; - dibs_class =class_create ("dibs" );if (IS_ERR (dibs_class))return PTR_ERR (dibs_class);Signature · 1 line
2.48.1
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Thu, 23 Oct 2025 17:06:35 +0200 you wrote:
'clients' and '
max_client' are static variables and therefore don't need to be initialized.Reported-by Mete Durlu <[email protected]>Signed-off-by Alexandra Winter <[email protected]>--- drivers/dibs/dibs_main.c | 3 --- 1 file changed, 3 deletions(-)
Here is the summary with links:
- [net-next,1/2] dibs: Remove reset of static vars in dibs_init()
https://git.kernel.org/netdev/net-next/c/182663bbff78 - [net-next,2/2] dibs: Use subsys_initcall() https://git.kernel.org/netdev/net-next/c/968822086b74
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html