linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Init: fixed an error caused by using __initdata instead of __initconst
@ 2020-01-06  2:02 carlosteniswarrior
  2020-01-09 16:26 ` kbuild test robot
  2020-01-09 18:49 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: carlosteniswarrior @ 2020-01-06  2:02 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Carlos Guerrero Alvarez

From: Carlos Guerrero Alvarez <carlosteniswarrior@gmail.com>

Fixed an error.

Signed-off-by: Carlos Guerrero Alvarez <carlosteniswarrior@gmail.com>
---
 init/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/main.c b/init/main.c
index 2cd736059416..bcf8aa4f7cab 100644
--- a/init/main.c
+++ b/init/main.c
@@ -979,7 +979,7 @@ static initcall_entry_t *initcall_levels[] __initdata = {
 };
 
 /* Keep these in sync with initcalls in include/linux/init.h */
-static const char *initcall_level_names[] __initdata = {
+static const char *initcall_level_names[] __initconst = {
 	"pure",
 	"core",
 	"postcore",
-- 
2.24.0


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

* Re: [PATCH] Init: fixed an error caused by using __initdata instead of __initconst
  2020-01-06  2:02 [PATCH] Init: fixed an error caused by using __initdata instead of __initconst carlosteniswarrior
@ 2020-01-09 16:26 ` kbuild test robot
  2020-01-09 18:49 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2020-01-09 16:26 UTC (permalink / raw)
  To: carlosteniswarrior
  Cc: kbuild-all, akpm, linux-kernel, Carlos Guerrero Alvarez

[-- Attachment #1: Type: text/plain, Size: 5222 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.5-rc5 next-20200108]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/carlosteniswarrior-gmail-com/Init-fixed-an-error-caused-by-using-__initdata-instead-of-__initconst/20200109-034253
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1522d9da40bdfe502c91163e6d769332897201fa
config: parisc-c3000_defconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

>> init/main.c:983:20: error: initcall_level_names causes a section type conflict with __setup_str_set_debug_rodata
    static const char *initcall_level_names[] __initconst = {
                       ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/module.h:12,
                    from init/main.c:17:
   include/linux/init.h:254:20: note: '__setup_str_set_debug_rodata' was declared here
     static const char __setup_str_##unique_id[] __initconst  \
                       ^
>> include/linux/init.h:262:2: note: in expansion of macro '__setup_param'
     __setup_param(str, fn, fn, 0)
     ^~~~~~~~~~~~~
>> init/main.c:1075:1: note: in expansion of macro '__setup'
    __setup("rodata=", set_debug_rodata);
    ^~~~~~~

vim +983 init/main.c

   981	
   982	/* Keep these in sync with initcalls in include/linux/init.h */
 > 983	static const char *initcall_level_names[] __initconst = {
   984		"pure",
   985		"core",
   986		"postcore",
   987		"arch",
   988		"subsys",
   989		"fs",
   990		"device",
   991		"late",
   992	};
   993	
   994	static void __init do_initcall_level(int level)
   995	{
   996		initcall_entry_t *fn;
   997	
   998		strcpy(initcall_command_line, saved_command_line);
   999		parse_args(initcall_level_names[level],
  1000			   initcall_command_line, __start___param,
  1001			   __stop___param - __start___param,
  1002			   level, level,
  1003			   NULL, &repair_env_string);
  1004	
  1005		trace_initcall_level(initcall_level_names[level]);
  1006		for (fn = initcall_levels[level]; fn < initcall_levels[level+1]; fn++)
  1007			do_one_initcall(initcall_from_entry(fn));
  1008	}
  1009	
  1010	static void __init do_initcalls(void)
  1011	{
  1012		int level;
  1013	
  1014		for (level = 0; level < ARRAY_SIZE(initcall_levels) - 1; level++)
  1015			do_initcall_level(level);
  1016	}
  1017	
  1018	/*
  1019	 * Ok, the machine is now initialized. None of the devices
  1020	 * have been touched yet, but the CPU subsystem is up and
  1021	 * running, and memory and process management works.
  1022	 *
  1023	 * Now we can finally start doing some real work..
  1024	 */
  1025	static void __init do_basic_setup(void)
  1026	{
  1027		cpuset_init_smp();
  1028		driver_init();
  1029		init_irq_proc();
  1030		do_ctors();
  1031		usermodehelper_enable();
  1032		do_initcalls();
  1033	}
  1034	
  1035	static void __init do_pre_smp_initcalls(void)
  1036	{
  1037		initcall_entry_t *fn;
  1038	
  1039		trace_initcall_level("early");
  1040		for (fn = __initcall_start; fn < __initcall0_start; fn++)
  1041			do_one_initcall(initcall_from_entry(fn));
  1042	}
  1043	
  1044	static int run_init_process(const char *init_filename)
  1045	{
  1046		argv_init[0] = init_filename;
  1047		pr_info("Run %s as init process\n", init_filename);
  1048		return do_execve(getname_kernel(init_filename),
  1049			(const char __user *const __user *)argv_init,
  1050			(const char __user *const __user *)envp_init);
  1051	}
  1052	
  1053	static int try_to_run_init_process(const char *init_filename)
  1054	{
  1055		int ret;
  1056	
  1057		ret = run_init_process(init_filename);
  1058	
  1059		if (ret && ret != -ENOENT) {
  1060			pr_err("Starting init: %s exists but couldn't execute it (error %d)\n",
  1061			       init_filename, ret);
  1062		}
  1063	
  1064		return ret;
  1065	}
  1066	
  1067	static noinline void __init kernel_init_freeable(void);
  1068	
  1069	#if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
  1070	bool rodata_enabled __ro_after_init = true;
  1071	static int __init set_debug_rodata(char *str)
  1072	{
  1073		return strtobool(str, &rodata_enabled);
  1074	}
> 1075	__setup("rodata=", set_debug_rodata);
  1076	#endif
  1077	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 15805 bytes --]

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

* Re: [PATCH] Init: fixed an error caused by using __initdata instead of __initconst
  2020-01-06  2:02 [PATCH] Init: fixed an error caused by using __initdata instead of __initconst carlosteniswarrior
  2020-01-09 16:26 ` kbuild test robot
@ 2020-01-09 18:49 ` kbuild test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2020-01-09 18:49 UTC (permalink / raw)
  To: carlosteniswarrior
  Cc: kbuild-all, akpm, linux-kernel, Carlos Guerrero Alvarez

[-- Attachment #1: Type: text/plain, Size: 3705 bytes --]

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.5-rc5 next-20200108]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/carlosteniswarrior-gmail-com/Init-fixed-an-error-caused-by-using-__initdata-instead-of-__initconst/20200109-034253
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1522d9da40bdfe502c91163e6d769332897201fa
config: mips-jmr3927_defconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:15,
                    from include/linux/list.h:9,
                    from include/linux/module.h:12,
                    from init/main.c:17:
>> include/linux/init.h:254:20: error: __setup_str_initcall_blacklist causes a section type conflict with initcall_level_names
     static const char __setup_str_##unique_id[] __initconst  \
                       ^
   include/linux/init.h:262:2: note: in expansion of macro '__setup_param'
     __setup_param(str, fn, fn, 0)
     ^~~~~~~~~~~~~
   init/main.c:874:1: note: in expansion of macro '__setup'
    __setup("initcall_blacklist=", initcall_blacklist);
    ^~~~~~~
   init/main.c:983:20: note: 'initcall_level_names' was declared here
    static const char *initcall_level_names[] __initconst = {
                       ^~~~~~~~~~~~~~~~~~~~

vim +254 include/linux/init.h

^1da177e4c3f41 Linus Torvalds 2005-04-16  246  
^1da177e4c3f41 Linus Torvalds 2005-04-16  247  /*
^1da177e4c3f41 Linus Torvalds 2005-04-16  248   * Only for really core code.  See moduleparam.h for the normal way.
^1da177e4c3f41 Linus Torvalds 2005-04-16  249   *
^1da177e4c3f41 Linus Torvalds 2005-04-16  250   * Force the alignment so the compiler doesn't space elements of the
^1da177e4c3f41 Linus Torvalds 2005-04-16  251   * obs_kernel_param "array" too far apart in .init.setup.
^1da177e4c3f41 Linus Torvalds 2005-04-16  252   */
^1da177e4c3f41 Linus Torvalds 2005-04-16  253  #define __setup_param(str, unique_id, fn, early)			\
fd6c3a8dc44329 Jan Beulich    2009-03-12 @254  	static const char __setup_str_##unique_id[] __initconst		\
fd6c3a8dc44329 Jan Beulich    2009-03-12  255  		__aligned(1) = str; 					\
^1da177e4c3f41 Linus Torvalds 2005-04-16  256  	static struct obs_kernel_param __setup_##unique_id		\
3ff6eecca4e5c4 Adrian Bunk    2008-01-24  257  		__used __section(.init.setup)				\
^1da177e4c3f41 Linus Torvalds 2005-04-16  258  		__attribute__((aligned((sizeof(long)))))		\
^1da177e4c3f41 Linus Torvalds 2005-04-16  259  		= { __setup_str_##unique_id, fn, early }
^1da177e4c3f41 Linus Torvalds 2005-04-16  260  

:::::: The code at line 254 was first introduced by commit
:::::: fd6c3a8dc44329d3aff9a578b5120982f63711ee initconst adjustments

:::::: TO: Jan Beulich <jbeulich@novell.com>
:::::: CC: Sam Ravnborg <sam@ravnborg.org>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 11893 bytes --]

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

end of thread, other threads:[~2020-01-09 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06  2:02 [PATCH] Init: fixed an error caused by using __initdata instead of __initconst carlosteniswarrior
2020-01-09 16:26 ` kbuild test robot
2020-01-09 18:49 ` kbuild test robot

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).