linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] um: remove uml initcalls
@ 2018-04-23 18:20 Alexander Pateenok
  2018-04-23 19:43 ` [uml-devel] " Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Pateenok @ 2018-04-23 18:20 UTC (permalink / raw)
  To: Jeff Dike, Richard Weinberger, user-mode-linux-devel, linux-um,
	linux-kernel

__uml_initcall() is not used and .uml.initcall.init section is empty:

$ grep -r '__uml_initcall('
arch/um/include/shared/init.h:#define __uml_initcall(fn)	\
$ readelf -s ../umobj/linux | grep __uml_initcall
 23214: 00000000603b75d8     0 NOTYPE  GLOBAL DEFAULT   32 __uml_initcall_start
 25337: 00000000603b75d8     0 NOTYPE  GLOBAL DEFAULT   32 __uml_initcall_end

So it is unnecessary.

Signed-off-by: Alexander Pateenok <pateenoc@gmail.com>
---
 arch/um/include/asm/common.lds.S |  6 ------
 arch/um/include/shared/init.h    |  5 -----
 arch/um/os-Linux/main.c          | 12 ------------
 3 files changed, 23 deletions(-)

diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index b30d73ca29d0..7adb4e6b658a 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -53,12 +53,6 @@
 	CON_INITCALL
   }
 
-  .uml.initcall.init : {
-	__uml_initcall_start = .;
-	*(.uml.initcall.init)
-	__uml_initcall_end = .;
-  }
-
   SECURITY_INIT
 
   .exitcall : {
diff --git a/arch/um/include/shared/init.h b/arch/um/include/shared/init.h
index b3f5865a92c9..c66de434a983 100644
--- a/arch/um/include/shared/init.h
+++ b/arch/um/include/shared/init.h
@@ -64,14 +64,10 @@ struct uml_param {
         int (*setup_func)(char *, int *);
 };
 
-extern initcall_t __uml_initcall_start, __uml_initcall_end;
 extern initcall_t __uml_postsetup_start, __uml_postsetup_end;
 extern const char *__uml_help_start, *__uml_help_end;
 #endif
 
-#define __uml_initcall(fn)					  	\
-	static initcall_t __uml_initcall_##fn __uml_init_call = fn
-
 #define __uml_exitcall(fn)						\
 	static exitcall_t __uml_exitcall_##fn __uml_exit_call = fn
 
@@ -108,7 +104,6 @@ extern struct uml_param __uml_setup_start, __uml_setup_end;
  */
 #define __uml_init_setup	__used __section(.uml.setup.init)
 #define __uml_setup_help	__used __section(.uml.help.init)
-#define __uml_init_call		__used __section(.uml.initcall.init)
 #define __uml_postsetup_call	__used __section(.uml.postsetup.init)
 #define __uml_exit_call		__used __section(.uml.exitcall.exit)
 
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
index 5f970ece5ac3..f1fee2b91239 100644
--- a/arch/um/os-Linux/main.c
+++ b/arch/um/os-Linux/main.c
@@ -40,17 +40,6 @@ static void set_stklim(void)
 	}
 }
 
-static __init void do_uml_initcalls(void)
-{
-	initcall_t *call;
-
-	call = &__uml_initcall_start;
-	while (call < &__uml_initcall_end) {
-		(*call)();
-		call++;
-	}
-}
-
 static void last_ditch_exit(int sig)
 {
 	uml_cleanup();
@@ -151,7 +140,6 @@ int __init main(int argc, char **argv, char **envp)
 	scan_elf_aux(envp);
 #endif
 
-	do_uml_initcalls();
 	change_sig(SIGPIPE, 0);
 	ret = linux_main(argc, argv);
 
-- 
2.16.3


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [uml-devel] [PATCH] um: remove uml initcalls
  2018-04-23 18:20 [PATCH] um: remove uml initcalls Alexander Pateenok
@ 2018-04-23 19:43 ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2018-04-23 19:43 UTC (permalink / raw)
  To: Alexander Pateenok
  Cc: Jeff Dike, linux-um, linux-kernel, user-mode-linux-devel

Alexander,

Am Montag, 23. April 2018, 20:20:17 CEST schrieb Alexander Pateenok:
> __uml_initcall() is not used and .uml.initcall.init section is empty:
> 
> $ grep -r '__uml_initcall('
> arch/um/include/shared/init.h:#define __uml_initcall(fn)	\
> $ readelf -s ../umobj/linux | grep __uml_initcall
>  23214: 00000000603b75d8     0 NOTYPE  GLOBAL DEFAULT   32 __uml_initcall_start
>  25337: 00000000603b75d8     0 NOTYPE  GLOBAL DEFAULT   32 __uml_initcall_end
> 
> So it is unnecessary.

Right. The last user was removed almost 10 years ago by:
d2efa6d5ce14 ("uml: remove the dead TTY_LOG code")

Thanks,
//richard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-23 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 18:20 [PATCH] um: remove uml initcalls Alexander Pateenok
2018-04-23 19:43 ` [uml-devel] " Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).