Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64

Allow 64-bit userspace programs to use ll64 types. The define name
comes from commit 2c9c6ce0199a4d252e20c531cfdc9d24e39235c0 (powerpc:
Add __SANE_USERSPACE_TYPES__ to asm/types.h for LL64).

The patch allows to compile perf on MIPS64 and eliminates the following
warnings:

tests/attr.c:74:4: error: format '%llu' expects argument of type 'long
long unsigned int', but argument 6 has type '__u64' [-Werror=format=]

Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/6890/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Aaro Koskinen and committed by
Ralf Baechle
f4b3aa7c 4fd4db4f

+4 -1
+4 -1
arch/mips/include/uapi/asm/types.h
··· 14 14 /* 15 15 * We don't use int-l64.h for the kernel anymore but still use it for 16 16 * userspace to avoid code changes. 17 + * 18 + * However, some user programs (e.g. perf) may not want this. They can 19 + * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here. 17 20 */ 18 21 #ifndef __KERNEL__ 19 - # if _MIPS_SZLONG == 64 22 + # if _MIPS_SZLONG == 64 && !defined(__SANE_USERSPACE_TYPES__) 20 23 # include <asm-generic/int-l64.h> 21 24 # else 22 25 # include <asm-generic/int-ll64.h>