arch/powerpc/include/asm/reg.h:1376:17: sparse: sparse: context imbalance in 'serial8250_console_write' - wrong count at exit

From: kernel test robot
Date: Tue Aug 18 2020 - 01:21:42 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06a4ec1d9dc652e17ee3ac2ceb6c7cf6c2b75cdd
commit: b020aa9d1e875c1c91b1390acdf42320e7060d84 powerpc: cleanup hw_irq.h
date: 9 months ago
config: powerpc64-randconfig-s031-20200818 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.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.2-180-g49f7e13a-dirty
git checkout b020aa9d1e875c1c91b1390acdf42320e7060d84
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64

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


sparse warnings: (new ones prefixed by >>)

drivers/tty/serial/8250/8250_port.c: note: in included file (through include/linux/io.h, include/linux/irq.h, arch/powerpc/include/asm/hardirq.h, ...):
arch/powerpc/include/asm/io.h:149:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:144:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:150:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:145:1: sparse: sparse: dereference of noderef expression
drivers/tty/serial/8250/8250_port.c: note: in included file (through arch/powerpc/include/asm/processor.h, arch/powerpc/include/asm/thread_info.h, include/linux/thread_info.h, ...):
>> arch/powerpc/include/asm/reg.h:1376:17: sparse: sparse: context imbalance in 'serial8250_console_write' - wrong count at exit

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b020aa9d1e875c1c91b1390acdf42320e7060d84
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b020aa9d1e875c1c91b1390acdf42320e7060d84
vim +/serial8250_console_write +1376 arch/powerpc/include/asm/reg.h

1359
1360 #define mfspr(rn) ({unsigned long rval; \
1361 asm volatile("mfspr %0," __stringify(rn) \
1362 : "=r" (rval)); rval;})
1363 #ifndef mtspr
1364 #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : \
1365 : "r" ((unsigned long)(v)) \
1366 : "memory")
1367 #endif
1368 #define wrtspr(rn) asm volatile("mtspr " __stringify(rn) ",0" : \
1369 : : "memory")
1370
1371 static inline void wrtee(unsigned long val)
1372 {
1373 if (__builtin_constant_p(val))
1374 asm volatile("wrteei %0" : : "i" ((val & MSR_EE) ? 1 : 0) : "memory");
1375 else
> 1376 asm volatile("wrtee %0" : : "r" (val) : "memory");
1377 }
1378

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

Attachment: .config.gz
Description: application/gzip