arch/csky/include/asm/uaccess.h:158:2: warning: 'retval' is used uninitialized in this function

From: kernel test robot
Date: Wed May 05 2021 - 04:02:13 EST


Hi Guo,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d665ea6ea86c785760ee4bad4543dab3267ad074
commit: e58a41c2226847fb1446f3942dc1b55af8acfe02 csky: uaccess.h: Coding convention with asm generic
date: 7 days ago
config: csky-randconfig-r023-20210505 (attached as .config)
compiler: csky-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e58a41c2226847fb1446f3942dc1b55af8acfe02
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e58a41c2226847fb1446f3942dc1b55af8acfe02
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=csky

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

All warnings (new ones prefixed by >>):

In file included from include/linux/uaccess.h:11,
from include/linux/sched/task.h:11,
from include/linux/sched/signal.h:9,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/huge_mm.h:8,
from include/linux/mm.h:707,
from include/linux/mman.h:5,
from lib/test_user_copy.c:13:
arch/csky/include/asm/uaccess.h: In function '__get_user_fn.constprop':
>> arch/csky/include/asm/uaccess.h:158:2: warning: 'retval' is used uninitialized in this function [-Wuninitialized]
158 | __asm__ __volatile__( \
| ^~~~~~~
arch/csky/include/asm/uaccess.h:181:6: note: 'retval' was declared here
181 | int retval;
| ^~~~~~


vim +/retval +158 arch/csky/include/asm/uaccess.h

152
153 #define __get_user_asm_64(x, ptr, err) \
154 do { \
155 int tmp; \
156 int errcode; \
157 \
> 158 __asm__ __volatile__( \
159 "1: ldw %3, (%2, 0) \n" \
160 " stw %3, (%1, 0) \n" \
161 "2: ldw %3, (%2, 4) \n" \
162 " stw %3, (%1, 4) \n" \
163 " br 4f \n" \
164 "3: mov %0, %4 \n" \
165 " br 4f \n" \
166 ".section __ex_table, \"a\" \n" \
167 ".align 2 \n" \
168 ".long 1b, 3b \n" \
169 ".long 2b, 3b \n" \
170 ".previous \n" \
171 "4: \n" \
172 : "=r"(err), "=r"(x), "=r"(ptr), \
173 "=r"(tmp), "=r"(errcode) \
174 : "0"(err), "1"(x), "2"(ptr), "3"(0), \
175 "4"(-EFAULT) \
176 : "memory"); \
177 } while (0)
178

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

Attachment: .config.gz
Description: application/gzip