All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Liangliang Huang <huanglllzu@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Huacai Chen <chenhc@lemote.com>
Subject: arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.
Date: Tue, 18 Aug 2020 14:06:08 +0800	[thread overview]
Message-ID: <202008181403.UpxHp569%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06a4ec1d9dc652e17ee3ac2ceb6c7cf6c2b75cdd
commit: c9b0299034665d594e56ee343f28033d1b24de6d MIPS: Use fallthrough for arch/mips
date:   3 months ago
config: mips-randconfig-m031-20200818 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.
arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.

Old smatch warnings:
arch/mips/kernel/traps.c:1914 nmi_exception_handler() warn: ignoring unreachable code.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b0299034665d594e56ee343f28033d1b24de6d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c9b0299034665d594e56ee343f28033d1b24de6d
vim +79 arch/mips/include/asm/fpu.h

    53	
    54	static inline int __enable_fpu(enum fpu_mode mode)
    55	{
    56		int fr;
    57	
    58		switch (mode) {
    59		case FPU_AS_IS:
    60			/* just enable the FPU in its current mode */
    61			set_c0_status(ST0_CU1);
    62			enable_fpu_hazard();
    63			return 0;
    64	
    65		case FPU_HYBRID:
    66			if (!cpu_has_fre)
    67				return SIGFPE;
    68	
    69			/* set FRE */
    70			set_c0_config5(MIPS_CONF5_FRE);
    71			goto fr_common;
    72	
    73		case FPU_64BIT:
    74	#if !(defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) \
    75	      || defined(CONFIG_64BIT))
    76			/* we only have a 32-bit FPU */
    77			return SIGFPE;
    78	#endif
  > 79			fallthrough;
    80		case FPU_32BIT:
    81			if (cpu_has_fre) {
    82				/* clear FRE */
    83				clear_c0_config5(MIPS_CONF5_FRE);
    84			}
    85	fr_common:
    86			/* set CU1 & change FR appropriately */
    87			fr = (int)mode & FPU_FR_MASK;
    88			change_c0_status(ST0_CU1 | ST0_FR, ST0_CU1 | (fr ? ST0_FR : 0));
    89			enable_fpu_hazard();
    90	
    91			/* check FR has the desired value */
    92			if (!!(read_c0_status() & ST0_FR) == !!fr)
    93				return 0;
    94	
    95			/* unsupported FR value */
    96			__disable_fpu();
    97			return SIGFPE;
    98	
    99		default:
   100			BUG();
   101		}
   102	
   103		return SIGFPE;
   104	}
   105	

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.
Date: Tue, 18 Aug 2020 14:06:08 +0800	[thread overview]
Message-ID: <202008181403.UpxHp569%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06a4ec1d9dc652e17ee3ac2ceb6c7cf6c2b75cdd
commit: c9b0299034665d594e56ee343f28033d1b24de6d MIPS: Use fallthrough for arch/mips
date:   3 months ago
config: mips-randconfig-m031-20200818 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0

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

New smatch warnings:
arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.
arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code.

Old smatch warnings:
arch/mips/kernel/traps.c:1914 nmi_exception_handler() warn: ignoring unreachable code.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c9b0299034665d594e56ee343f28033d1b24de6d
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout c9b0299034665d594e56ee343f28033d1b24de6d
vim +79 arch/mips/include/asm/fpu.h

    53	
    54	static inline int __enable_fpu(enum fpu_mode mode)
    55	{
    56		int fr;
    57	
    58		switch (mode) {
    59		case FPU_AS_IS:
    60			/* just enable the FPU in its current mode */
    61			set_c0_status(ST0_CU1);
    62			enable_fpu_hazard();
    63			return 0;
    64	
    65		case FPU_HYBRID:
    66			if (!cpu_has_fre)
    67				return SIGFPE;
    68	
    69			/* set FRE */
    70			set_c0_config5(MIPS_CONF5_FRE);
    71			goto fr_common;
    72	
    73		case FPU_64BIT:
    74	#if !(defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) \
    75	      || defined(CONFIG_64BIT))
    76			/* we only have a 32-bit FPU */
    77			return SIGFPE;
    78	#endif
  > 79			fallthrough;
    80		case FPU_32BIT:
    81			if (cpu_has_fre) {
    82				/* clear FRE */
    83				clear_c0_config5(MIPS_CONF5_FRE);
    84			}
    85	fr_common:
    86			/* set CU1 & change FR appropriately */
    87			fr = (int)mode & FPU_FR_MASK;
    88			change_c0_status(ST0_CU1 | ST0_FR, ST0_CU1 | (fr ? ST0_FR : 0));
    89			enable_fpu_hazard();
    90	
    91			/* check FR has the desired value */
    92			if (!!(read_c0_status() & ST0_FR) == !!fr)
    93				return 0;
    94	
    95			/* unsupported FR value */
    96			__disable_fpu();
    97			return SIGFPE;
    98	
    99		default:
   100			BUG();
   101		}
   102	
   103		return SIGFPE;
   104	}
   105	

---
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: 34638 bytes --]

             reply	other threads:[~2020-08-18  6:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  6:06 kernel test robot [this message]
2020-08-18  6:06 ` arch/mips/include/asm/fpu.h:79 __enable_fpu() warn: ignoring unreachable code kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-04-23 18:50 kernel test robot
2020-06-24 21:03 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202008181403.UpxHp569%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=chenhc@lemote.com \
    --cc=huanglllzu@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.