mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.
@ 2023-11-28  6:22 Dan Carpenter
  2023-12-09  0:33 ` Vineet Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2023-11-28  6:22 UTC (permalink / raw)
  To: oe-kbuild, Vineet Gupta; +Cc: lkp, oe-kbuild-all, linux-kernel, linux-snps-arc

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
commit: fad84e39f116035ae8d550c6020107b8ac113b45 ARC: boot log: eliminate struct cpuinfo_arc #4: boot log per ISA
config: arc-randconfig-r071-20231128 (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202311280906.VAIwEAfT-lkp@intel.com/

New smatch warnings:
arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.

Old smatch warnings:
arch/arc/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.

vim +/release +203 arch/arc/kernel/setup.c

fad84e39f11603 Vineet Gupta 2020-06-11  150  static int arcv2_mumbojumbo(int c, struct cpuinfo_arc *info, char *buf, int len)
fad84e39f11603 Vineet Gupta 2020-06-11  151  {
fad84e39f11603 Vineet Gupta 2020-06-11  152  	int n = 0;
fad84e39f11603 Vineet Gupta 2020-06-11  153  #ifdef CONFIG_ISA_ARCV2
fad84e39f11603 Vineet Gupta 2020-06-11  154  	const char *release, *cpu_nm, *isa_nm = "ARCv2";
fad84e39f11603 Vineet Gupta 2020-06-11  155  	int dual_issue = 0, dual_enb = 0, mpy_opt, present;
fad84e39f11603 Vineet Gupta 2020-06-11  156  	int bpu_full, bpu_cache, bpu_pred, bpu_ret_stk;
fad84e39f11603 Vineet Gupta 2020-06-11  157  	char mpy_nm[16], lpb_nm[32];
fad84e39f11603 Vineet Gupta 2020-06-11  158  	struct bcr_isa_arcv2 isa;
fad84e39f11603 Vineet Gupta 2020-06-11  159  	struct bcr_mpy mpy;
fad84e39f11603 Vineet Gupta 2020-06-11  160  	struct bcr_fp_arcv2 fpu;
fad84e39f11603 Vineet Gupta 2020-06-11  161  	struct bcr_bpu_arcv2 bpu;
fad84e39f11603 Vineet Gupta 2020-06-11  162  	struct bcr_lpb lpb;
fad84e39f11603 Vineet Gupta 2020-06-11  163  	struct bcr_iccm_arcv2 iccm;
fad84e39f11603 Vineet Gupta 2020-06-11  164  	struct bcr_dccm_arcv2 dccm;
fad84e39f11603 Vineet Gupta 2020-06-11  165  	struct bcr_erp erp;
00a4ae65cc600b Vineet Gupta 2019-02-25  166  
00a4ae65cc600b Vineet Gupta 2019-02-25  167  	/*
97d0b5d0b5a998 Vineet Gupta 2020-06-10  168  	 * Initial HS cores bumped AUX IDENTITY.ARCVER for each release until
97d0b5d0b5a998 Vineet Gupta 2020-06-10  169  	 * ARCVER 0x54 which introduced AUX MICRO_ARCH_BUILD and subsequent
97d0b5d0b5a998 Vineet Gupta 2020-06-10  170  	 * releases only update it.
00a4ae65cc600b Vineet Gupta 2019-02-25  171  	 */
00a4ae65cc600b Vineet Gupta 2019-02-25  172  
fad84e39f11603 Vineet Gupta 2020-06-11  173  	cpu_nm = "HS38";
00a4ae65cc600b Vineet Gupta 2019-02-25  174  
fad84e39f11603 Vineet Gupta 2020-06-11  175  	if (info->arcver > 0x50 && info->arcver <= 0x53) {
fad84e39f11603 Vineet Gupta 2020-06-11  176  		release = arc_hs_rel[info->arcver - 0x51].str;
00a4ae65cc600b Vineet Gupta 2019-02-25  177  	} else {
fad84e39f11603 Vineet Gupta 2020-06-11  178  		const struct id_to_str *tbl;
fad84e39f11603 Vineet Gupta 2020-06-11  179  		struct bcr_uarch_build uarch;
fad84e39f11603 Vineet Gupta 2020-06-11  180  
fad84e39f11603 Vineet Gupta 2020-06-11  181  		READ_BCR(ARC_REG_MICRO_ARCH_BCR, uarch);
00a4ae65cc600b Vineet Gupta 2019-02-25  182  
97d0b5d0b5a998 Vineet Gupta 2020-06-10  183  		for (tbl = &arc_hs_ver54_rel[0]; tbl->id != 0xFF; tbl++) {
00a4ae65cc600b Vineet Gupta 2019-02-25  184  			if (uarch.maj == tbl->id) {
fad84e39f11603 Vineet Gupta 2020-06-11  185  				release = tbl->str;

Will we always hit this assignment?

d975cbc8acb6f4 Vineet Gupta 2016-10-27  186  				break;
d975cbc8acb6f4 Vineet Gupta 2016-10-27  187  			}
00a4ae65cc600b Vineet Gupta 2019-02-25  188  		}
fad84e39f11603 Vineet Gupta 2020-06-11  189  		if (uarch.prod == 4) {
fad84e39f11603 Vineet Gupta 2020-06-11  190  			unsigned int exec_ctrl;
00a4ae65cc600b Vineet Gupta 2019-02-25  191  
fad84e39f11603 Vineet Gupta 2020-06-11  192  			cpu_nm = "HS48";
fad84e39f11603 Vineet Gupta 2020-06-11  193  			dual_issue = 1;
fad84e39f11603 Vineet Gupta 2020-06-11  194  			/* if dual issue hardware, is it enabled ? */
fad84e39f11603 Vineet Gupta 2020-06-11  195  			READ_BCR(AUX_EXEC_CTRL, exec_ctrl);
fad84e39f11603 Vineet Gupta 2020-06-11  196  			dual_enb = !(exec_ctrl & 1);
fad84e39f11603 Vineet Gupta 2020-06-11  197  		}
fad84e39f11603 Vineet Gupta 2020-06-11  198  	}
73e284d2572581 Vineet Gupta 2016-10-20  199  
fad84e39f11603 Vineet Gupta 2020-06-11  200  	READ_BCR(ARC_REG_ISA_CFG_BCR, isa);
b89bd1f4fbaeca Vineet Gupta 2016-01-22  201  
fad84e39f11603 Vineet Gupta 2020-06-11  202  	n += scnprintf(buf + n, len - n, "processor [%d]\t: %s %s (%s ISA) %s%s%s\n",
fad84e39f11603 Vineet Gupta 2020-06-11 @203  		       c, cpu_nm, release, isa_nm,
fad84e39f11603 Vineet Gupta 2020-06-11  204  		       IS_AVAIL1(isa.be, "[Big-Endian]"),
fad84e39f11603 Vineet Gupta 2020-06-11  205  		       IS_AVAIL3(dual_issue, dual_enb, " Dual-Issue "));
af61742813aa9d Vineet Gupta 2013-01-18  206  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


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

* Re: arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.
  2023-11-28  6:22 arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release' Dan Carpenter
@ 2023-12-09  0:33 ` Vineet Gupta
  2023-12-09  6:53   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Vineet Gupta @ 2023-12-09  0:33 UTC (permalink / raw)
  To: Dan Carpenter, oe-kbuild, Vineet Gupta
  Cc: lkp, oe-kbuild-all, linux-kernel, linux-snps-arc

On 11/27/23 22:22, Dan Carpenter wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
> commit: fad84e39f116035ae8d550c6020107b8ac113b45 ARC: boot log: eliminate struct cpuinfo_arc #4: boot log per ISA
> config: arc-randconfig-r071-20231128 (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/config)
> compiler: arceb-elf-gcc (GCC) 13.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Closes: https://lore.kernel.org/r/202311280906.VAIwEAfT-lkp@intel.com/
>
> New smatch warnings:
> arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.

Thx, I've posted a fix.

> Old smatch warnings:
> arch/arc/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.

This seems like a false warning. Its a register variable and thus can't
possibly be initialized.

static inline __attribute_const__ struct thread_info
*current_thread_info(void)
{
    register unsigned long sp asm("sp");
    return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));
}

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

* Re: arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.
  2023-12-09  0:33 ` Vineet Gupta
@ 2023-12-09  6:53   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-12-09  6:53 UTC (permalink / raw)
  To: Vineet Gupta; +Cc: oe-kbuild, lkp, oe-kbuild-all, linux-kernel, linux-snps-arc

On Fri, Dec 08, 2023 at 04:33:44PM -0800, Vineet Gupta wrote:
> On 11/27/23 22:22, Dan Carpenter wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   2cc14f52aeb78ce3f29677c2de1f06c0e91471ab
> > commit: fad84e39f116035ae8d550c6020107b8ac113b45 ARC: boot log: eliminate struct cpuinfo_arc #4: boot log per ISA
> > config: arc-randconfig-r071-20231128 (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/config)
> > compiler: arceb-elf-gcc (GCC) 13.2.0
> > reproduce: (https://download.01.org/0day-ci/archive/20231128/202311280906.VAIwEAfT-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Reported-by: Dan Carpenter <error27@gmail.com>
> > | Closes: https://lore.kernel.org/r/202311280906.VAIwEAfT-lkp@intel.com/
> >
> > New smatch warnings:
> > arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release'.
> 
> Thx, I've posted a fix.
> 
> > Old smatch warnings:
> > arch/arc/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.
> 
> This seems like a false warning. Its a register variable and thus can't
> possibly be initialized.

Yeah.  Sorry, I normally delete these but I somehow forgot this time.

regards,
dan carpenter


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

end of thread, other threads:[~2023-12-09  6:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28  6:22 arch/arc/kernel/setup.c:203 arcv2_mumbojumbo() error: uninitialized symbol 'release' Dan Carpenter
2023-12-09  0:33 ` Vineet Gupta
2023-12-09  6:53   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®