arch/h8300/include/asm/flat.h:31:1: error: expected expression before '}' token

From: kbuild test robot
Date: Sat Jul 15 2017 - 21:38:06 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5771a8c08880cdca3bfb4a3fc6d309d6bba20877
commit: 468138d78510688fb5476f98d23f11ac6a63229a binfmt_flat: flat_{get,put}_addr_from_rp() should be able to fail
date: 12 days ago
config: h8300-h8300h-sim_defconfig (attached as .config)
compiler: h8300-linux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 468138d78510688fb5476f98d23f11ac6a63229a
# save the attached .config to linux build tree
make.cross ARCH=h8300

All errors (new ones prefixed by >>):

In file included from include/linux/flat.h:13:0,
from fs/binfmt_flat.c:36:
arch/h8300/include/asm/flat.h: In function 'flat_get_addr_from_rp':
arch/h8300/include/asm/flat.h:28:3: error: expected ')' before 'val'
val &= 0x00ffffff;
^~~
>> arch/h8300/include/asm/flat.h:31:1: error: expected expression before '}' token
}
^
arch/h8300/include/asm/flat.h:26:6: warning: unused variable 'val' [-Wunused-variable]
u32 val = get_unaligned((__force u32 *)rp);
^~~
arch/h8300/include/asm/flat.h:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
In file included from include/linux/kernel.h:13:0,
from fs/binfmt_flat.c:20:
fs/binfmt_flat.c: In function 'load_flat_file':
include/linux/kern_levels.h:4:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'u32 {aka unsigned int}' [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
include/linux/printk.h:136:11: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~
include/linux/kern_levels.h:14:20: note: in expansion of macro 'KERN_SOH'
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
^~~~~~~~
include/linux/printk.h:339:12: note: in expansion of macro 'KERN_DEBUG'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~
fs/binfmt_flat.c:577:3: note: in expansion of macro 'pr_debug'
pr_debug("Allocated data+bss+stack (%ld bytes): %lx\n",
^~~~~~~~

vim +31 arch/h8300/include/asm/flat.h

14
15 /*
16 * on the H8 a couple of the relocations have an instruction in the
17 * top byte. As there can only be 24bits of address space, we just
18 * always preserve that 8bits at the top, when it isn't an instruction
19 * is is 0 (davidm@xxxxxxxxxxxx)
20 */
21
22 #define flat_get_relocate_addr(rel) (rel & ~0x00000001)
23 static inline int flat_get_addr_from_rp(u32 __user *rp, u32 relval, u32 flags,
24 u32 *addr, u32 *persistent)
25 {
26 u32 val = get_unaligned((__force u32 *)rp);
27 if (!(flags & FLAT_FLAG_GOTPIC)
> 28 val &= 0x00ffffff;
29 *addr = val;
30 return 0;
> 31 }
32

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip