All of lore.kernel.org
 help / color / mirror / Atom feed
* [arm-integrator:kasan 2/7] arch/arm/kernel/setup.c:1082:6: warning: variable 'atags_vaddr' is used uninitialized whenever 'if' condition is false
@ 2020-10-06 18:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-10-06 18:14 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kasan
head:   5f59c4b4d210bba804bdce643f9c067246d6e244
commit: 37d8ebb48491dab3fe0d926693f6b27ddc32eebd [2/7] ARM: move device tree mapping out of linear region
config: arm-randconfig-r003-20201006 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1127662c6dc2a276839c75a42238b11a3ad00f32)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/commit/?id=37d8ebb48491dab3fe0d926693f6b27ddc32eebd
        git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
        git fetch --no-tags arm-integrator kasan
        git checkout 37d8ebb48491dab3fe0d926693f6b27ddc32eebd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

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

All warnings (new ones prefixed by >>):

>> arch/arm/kernel/setup.c:1082:6: warning: variable 'atags_vaddr' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (__atags_pointer)
               ^~~~~~~~~~~~~~~
   arch/arm/kernel/setup.c:1086:6: note: uninitialized use occurs here
           if (atags_vaddr) {
               ^~~~~~~~~~~
   arch/arm/kernel/setup.c:1082:2: note: remove the 'if' if its condition is always true
           if (__atags_pointer)
           ^~~~~~~~~~~~~~~~~~~~
   arch/arm/kernel/setup.c:1080:19: note: initialize the variable 'atags_vaddr' to silence this warning
           void *atags_vaddr;
                            ^
                             = NULL
   1 warning generated.

vim +1082 arch/arm/kernel/setup.c

4588c34daabb5ae Dave Martin    2012-02-17  1076  
6291319d4864848 Grant Likely   2011-04-28  1077  void __init setup_arch(char **cmdline_p)
6291319d4864848 Grant Likely   2011-04-28  1078  {
6f508bba1738a1c Ard Biesheuvel 2020-10-06  1079  	const struct machine_desc *mdesc = NULL;
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1080  	void *atags_vaddr;
6f508bba1738a1c Ard Biesheuvel 2020-10-06  1081  
6f508bba1738a1c Ard Biesheuvel 2020-10-06 @1082  	if (__atags_pointer)
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1083  		atags_vaddr = FDT_VIRT_ADDR(__atags_pointer);
6291319d4864848 Grant Likely   2011-04-28  1084  
6291319d4864848 Grant Likely   2011-04-28  1085  	setup_processor();
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1086  	if (atags_vaddr) {
6f508bba1738a1c Ard Biesheuvel 2020-10-06  1087  		mdesc = setup_machine_fdt(atags_vaddr);
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1088  		if (mdesc)
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1089  			memblock_reserve(__atags_pointer,
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1090  					 fdt_totalsize(atags_vaddr));
37d8ebb48491dab Ard Biesheuvel 2020-10-06  1091  	}
93c02ab40ae6e06 Grant Likely   2011-04-28  1092  	if (!mdesc)
6f508bba1738a1c Ard Biesheuvel 2020-10-06  1093  		mdesc = setup_machine_tags(atags_vaddr, __machine_arch_type);
99cf8f903148347 Russell King   2017-09-21  1094  	if (!mdesc) {
99cf8f903148347 Russell King   2017-09-21  1095  		early_print("\nError: invalid dtb and unrecognized/unsupported machine ID\n");
99cf8f903148347 Russell King   2017-09-21  1096  		early_print("  r1=0x%08x, r2=0x%08x\n", __machine_arch_type,
99cf8f903148347 Russell King   2017-09-21  1097  			    __atags_pointer);
99cf8f903148347 Russell King   2017-09-21  1098  		if (__atags_pointer)
6f508bba1738a1c Ard Biesheuvel 2020-10-06  1099  			early_print("  r2[]=%*ph\n", 16, atags_vaddr);
99cf8f903148347 Russell King   2017-09-21  1100  		dump_machine_table();
99cf8f903148347 Russell King   2017-09-21  1101  	}
99cf8f903148347 Russell King   2017-09-21  1102  
6291319d4864848 Grant Likely   2011-04-28  1103  	machine_desc = mdesc;
6291319d4864848 Grant Likely   2011-04-28  1104  	machine_name = mdesc->name;
719c9d1489bad6f Russell King   2014-10-28  1105  	dump_stack_set_arch_desc("%s", mdesc->name);
6291319d4864848 Grant Likely   2011-04-28  1106  
16d6d5b00ee7530 Robin Holt     2013-07-08  1107  	if (mdesc->reboot_mode != REBOOT_HARD)
16d6d5b00ee7530 Robin Holt     2013-07-08  1108  		reboot_mode = mdesc->reboot_mode;
6291319d4864848 Grant Likely   2011-04-28  1109  
37efe6427dd50e8 Russell King   2008-12-01  1110  	init_mm.start_code = (unsigned long) _text;
37efe6427dd50e8 Russell King   2008-12-01  1111  	init_mm.end_code   = (unsigned long) _etext;
37efe6427dd50e8 Russell King   2008-12-01  1112  	init_mm.end_data   = (unsigned long) _edata;
37efe6427dd50e8 Russell King   2008-12-01  1113  	init_mm.brk	   = (unsigned long) _end;
^1da177e4c3f415 Linus Torvalds 2005-04-16  1114  
48ab7e09e0a7c00 Jeremy Kerr    2010-01-27  1115  	/* populate cmd_line too for later use, preserving boot_command_line */
48ab7e09e0a7c00 Jeremy Kerr    2010-01-27  1116  	strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
48ab7e09e0a7c00 Jeremy Kerr    2010-01-27  1117  	*cmdline_p = cmd_line;
2b0d8c251b8876d Jeremy Kerr    2010-01-11  1118  
a5f4c561b3b19a9 Stefan Agner   2015-08-13  1119  	early_fixmap_init();
2937367b8a4b0d4 Ard Biesheuvel 2015-09-01  1120  	early_ioremap_init();
a5f4c561b3b19a9 Stefan Agner   2015-08-13  1121  
2b0d8c251b8876d Jeremy Kerr    2010-01-11  1122  	parse_early_param();
2b0d8c251b8876d Jeremy Kerr    2010-01-11  1123  

:::::: The code at line 1082 was first introduced by commit
:::::: 6f508bba1738a1c09850787a543b1df44ce92916 ARM: centralize phys-to-virt conversion of DT/ATAGS address

:::::: TO: Ard Biesheuvel <ardb@kernel.org>
:::::: CC: Linus Walleij <linus.walleij@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-06 18:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 18:14 [arm-integrator:kasan 2/7] arch/arm/kernel/setup.c:1082:6: warning: variable 'atags_vaddr' is used uninitialized whenever 'if' condition is false kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.