From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4923667514228058662==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: arch/sh/kernel/traps_32.c:574:9: sparse: sparse: incorrect type in initializer (different address spaces) Date: Thu, 17 Feb 2022 17:10:24 +0800 Message-ID: <202202171703.uSwiYZal-lkp@intel.com> List-Id: --===============4923667514228058662== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: f71077a4d84bbe8c7b91b7db7c4ef815755ac5e3 commit: ca42bc4b7bda7c6d68f1cc97c27fc8ff7385c4c7 sh: fix trivial misannotat= ions date: 5 months ago config: sh-randconfig-s032-20220217 (https://download.01.org/0day-ci/archiv= e/20220217/202202171703.uSwiYZal-lkp(a)intel.com/config) compiler: sh4-linux-gcc (GCC) 11.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-dirty # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t/commit/?id=3Dca42bc4b7bda7c6d68f1cc97c27fc8ff7385c4c7 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/gi= t/torvalds/linux.git git fetch --no-tags linus master git checkout ca42bc4b7bda7c6d68f1cc97c27fc8ff7385c4c7 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=3Dbuild_dir ARCH=3Ds= h SHELL=3D/bin/bash arch/sh/kernel/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> arch/sh/kernel/traps_32.c:574:9: sparse: sparse: incorrect type in initi= alizer (different address spaces) @@ expected unsigned short const [nod= eref] __user *__gu_addr @@ got unsigned short * @@ arch/sh/kernel/traps_32.c:574:9: sparse: expected unsigned short con= st [noderef] __user *__gu_addr arch/sh/kernel/traps_32.c:574:9: sparse: got unsigned short * arch/sh/kernel/traps_32.c:563:5: sparse: sparse: symbol 'is_dsp_inst' wa= s not declared. Should it be static? vim +574 arch/sh/kernel/traps_32.c ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 558 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 559 #ifde= f CONFIG_SH_DSP ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 560 /* ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 561 * SH= -DSP support gerg(a)snapgear.com. ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 562 */ ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 563 int i= s_dsp_inst(struct pt_regs *regs) ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 564 { 882c12c4e1a95e arch/sh/kernel/traps.c Paul Mundt 2007-05-14 565 unsi= gned short inst =3D 0; ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 566 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 567 /* ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 568 * S= afe guard if DSP mode is already enabled or we're lacking ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 569 * t= he DSP altogether. ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 570 */ 11c1965687b0a4 arch/sh/kernel/traps.c Paul Mundt 2006-12-25 571 if (= !(current_cpu_data.flags & CPU_HAS_DSP) || (regs->sr & SR_DSP)) ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 572 ret= urn 0; ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 573 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 @574 get_= user(inst, ((unsigned short *) regs->pc)); ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 575 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 576 inst= &=3D 0xf000; ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 577 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 578 /* C= heck for any type of DSP or support instruction */ ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 579 if (= (inst =3D=3D 0xf000) || (inst =3D=3D 0x4000)) ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 580 ret= urn 1; ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 581 = ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 582 retu= rn 0; ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 583 } ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 584 #else ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 585 #defi= ne is_dsp_inst(regs) (0) ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 586 #endi= f /* CONFIG_SH_DSP */ ^1da177e4c3f41 arch/sh/kernel/traps.c Linus Torvalds 2005-04-16 587 = :::::: The code at line 574 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds :::::: CC: Linus Torvalds --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============4923667514228058662==--