linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/13] MIPS: fix modversions
@ 2017-01-17 15:18 Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, Al Viro, James Hogan,
	Maciej W. Rozycki, linux-kernel

kernelci.org reports tons of build warnings for linux-next:

35	WARNING: "memcpy" [fs/fat/msdos.ko] has no CRC!
35	WARNING: "__copy_user" [fs/fat/fat.ko] has no CRC!
32	WARNING: EXPORT symbol "memset" [vmlinux] version generation failed, symbol will not be versioned.
32	WARNING: EXPORT symbol "copy_page" [vmlinux] version generation failed, symbol will not be versioned.
32	WARNING: EXPORT symbol "clear_page" [vmlinux] version generation failed, symbol will not be versioned.
32	WARNING: EXPORT symbol "__strncpy_from_user_nocheck_asm" [vmlinux] version generation failed, symbol will not be versioned.

The problem here is mainly the missing asm/asm-prototypes.h header file
that is supposed to include the prototypes for each symbol that is exported
from an assembler file.

A second problem is that the asm/uaccess.h header contains some but not
all the necessary declarations for the user access helpers.

Finally, the vdso build is broken once we add asm/asm-prototypes.h, so
we have to fix this at the same time by changing the vdso header. My
approach here is to just not look for exported symbols in the VDSO
assembler files, as the symbols cannot be exported anyway.

Fixes: 576a2f0c5c6d ("MIPS: Export memcpy & memset functions alongside their definitions")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/include/asm/uaccess.h | 18 ++++++++++++++++++
 arch/mips/lib/strlen_user.S     |  4 +++-
 arch/mips/lib/strncpy_user.S    | 10 ++++++----
 arch/mips/lib/strnlen_user.S    |  8 ++++++--
 arch/mips/vdso/Makefile         |  7 +++++--
 5 files changed, 38 insertions(+), 9 deletions(-)

diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index 89fa5c0b1579..5347cfe15af2 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -1241,6 +1241,9 @@ extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
 	__cu_len;							\
 })
 
+extern __kernel_size_t __bzero_kernel(void __user *addr, __kernel_size_t size);
+extern __kernel_size_t __bzero(void __user *addr, __kernel_size_t size);
+
 /*
  * __clear_user: - Zero a block of memory in user space, with less checking.
  * @to:	  Destination address, in user space.
@@ -1293,6 +1296,9 @@ __clear_user(void __user *addr, __kernel_size_t size)
 	__cl_size;							\
 })
 
+extern long __strncpy_from_kernel_nocheck_asm(char *__to, const char __user *__from, long __len);
+extern long __strncpy_from_user_nocheck_asm(char *__to, const char __user *__from, long __len);
+
 /*
  * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -1344,6 +1350,9 @@ __strncpy_from_user(char *__to, const char __user *__from, long __len)
 	return res;
 }
 
+extern long __strncpy_from_kernel_asm(char *__to, const char __user *__from, long __len);
+extern long __strncpy_from_user_asm(char *__to, const char __user *__from, long __len);
+
 /*
  * strncpy_from_user: - Copy a NUL terminated string from userspace.
  * @dst:   Destination address, in kernel space.  This buffer must be at
@@ -1393,6 +1402,9 @@ strncpy_from_user(char *__to, const char __user *__from, long __len)
 	return res;
 }
 
+extern long __strlen_kernel_asm(const char __user *s);
+extern long __strlen_user_asm(const char __user *s);
+
 /*
  * strlen_user: - Get the size of a string in user space.
  * @str: The string to measure.
@@ -1434,6 +1446,9 @@ static inline long strlen_user(const char __user *s)
 	return res;
 }
 
+extern long __strnlen_kernel_nocheck_asm(const char __user *s, long n);
+extern long __strnlen_user_nocheck_asm(const char __user *s, long n);
+
 /* Returns: 0 if bad, string length+1 (memory size) of string if ok */
 static inline long __strnlen_user(const char __user *s, long n)
 {
@@ -1463,6 +1478,9 @@ static inline long __strnlen_user(const char __user *s, long n)
 	return res;
 }
 
+extern long __strnlen_kernel_asm(const char __user *s, long n);
+extern long __strnlen_user_asm(const char __user *s, long n);
+
 /*
  * strnlen_user: - Get the size of a string in user space.
  * @str: The string to measure.
diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S
index c9cb7e6c59a6..40be22625bc5 100644
--- a/arch/mips/lib/strlen_user.S
+++ b/arch/mips/lib/strlen_user.S
@@ -25,7 +25,6 @@
  */
 	.macro __BUILD_STRLEN_ASM func
 LEAF(__strlen_\func\()_asm)
-EXPORT_SYMBOL(__strlen_\func\()_asm)
 	LONG_L		v0, TI_ADDR_LIMIT($28)	# pointer ok?
 	and		v0, a0
 	bnez		v0, .Lfault\@
@@ -50,9 +49,11 @@ EXPORT_SYMBOL(__strlen_\func\()_asm)
 	/* Set aliases */
 	.global __strlen_user_asm
 	.set __strlen_user_asm, __strlen_kernel_asm
+EXPORT_SYMBOL(__strlen_user_asm)
 #endif
 
 __BUILD_STRLEN_ASM kernel
+EXPORT_SYMBOL(__strlen_kernel_asm)
 
 #ifdef CONFIG_EVA
 
@@ -60,4 +61,5 @@ __BUILD_STRLEN_ASM kernel
 	.set eva
 __BUILD_STRLEN_ASM user
 	.set pop
+EXPORT_SYMBOL(__strlen_user_asm)
 #endif
diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S
index af745b1d04e3..5267ca800b84 100644
--- a/arch/mips/lib/strncpy_user.S
+++ b/arch/mips/lib/strncpy_user.S
@@ -31,13 +31,11 @@
 
 	.macro __BUILD_STRNCPY_ASM func
 LEAF(__strncpy_from_\func\()_asm)
-EXPORT_SYMBOL(__strncpy_from_\func\()_asm)
 	LONG_L		v0, TI_ADDR_LIMIT($28)	# pointer ok?
 	and		v0, a1
 	bnez		v0, .Lfault\@
 
 FEXPORT(__strncpy_from_\func\()_nocheck_asm)
-EXPORT_SYMBOL(__strncpy_from_\func\()_nocheck_asm)
 	move		t0, zero
 	move		v1, a1
 .ifeqs "\func","kernel"
@@ -75,15 +73,19 @@ EXPORT_SYMBOL(__strncpy_from_\func\()_nocheck_asm)
 	.global __strncpy_from_user_nocheck_asm
 	.set __strncpy_from_user_asm, __strncpy_from_kernel_asm
 	.set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
-	EXPORT_SYMBOL(__strncpy_from_user_asm)
-	EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
+EXPORT_SYMBOL(__strncpy_from_user_asm)
+EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
 #endif
 
 __BUILD_STRNCPY_ASM kernel
+EXPORT_SYMBOL(__strncpy_from_kernel_asm)
+EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm)
 
 #ifdef CONFIG_EVA
 	.set push
 	.set eva
 __BUILD_STRNCPY_ASM user
 	.set pop
+EXPORT_SYMBOL(__strncpy_from_user_asm)
+EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
 #endif
diff --git a/arch/mips/lib/strnlen_user.S b/arch/mips/lib/strnlen_user.S
index 3ac38162d7f0..860ea99fd70c 100644
--- a/arch/mips/lib/strnlen_user.S
+++ b/arch/mips/lib/strnlen_user.S
@@ -28,13 +28,11 @@
  */
 	.macro __BUILD_STRNLEN_ASM func
 LEAF(__strnlen_\func\()_asm)
-EXPORT_SYMBOL(__strnlen_\func\()_asm)
 	LONG_L		v0, TI_ADDR_LIMIT($28)	# pointer ok?
 	and		v0, a0
 	bnez		v0, .Lfault\@
 
 FEXPORT(__strnlen_\func\()_nocheck_asm)
-EXPORT_SYMBOL(__strnlen_\func\()_nocheck_asm)
 	move		v0, a0
 	PTR_ADDU	a1, a0			# stop pointer
 1:
@@ -73,9 +71,13 @@ EXPORT_SYMBOL(__strnlen_\func\()_nocheck_asm)
 	.global __strnlen_user_nocheck_asm
 	.set __strnlen_user_asm, __strnlen_kernel_asm
 	.set __strnlen_user_nocheck_asm, __strnlen_kernel_nocheck_asm
+EXPORT_SYMBOL(__strnlen_user_asm)
+EXPORT_SYMBOL(__strnlen_user_nocheck_asm)
 #endif
 
 __BUILD_STRNLEN_ASM kernel
+EXPORT_SYMBOL(__strnlen_kernel_asm)
+EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm)
 
 #ifdef CONFIG_EVA
 
@@ -83,4 +85,6 @@ __BUILD_STRNLEN_ASM kernel
 	.set eva
 __BUILD_STRNLEN_ASM user
 	.set pop
+EXPORT_SYMBOL(__strnlen_user_asm)
+EXPORT_SYMBOL(__strnlen_user_nocheck_asm)
 #endif
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index c3dc12a8b7d9..4f42bd213538 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -50,6 +50,9 @@ quiet_cmd_vdsold = VDSO    $@
       cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@
 
+quiet_cmd_vdsoas_o_S = AS       $@
+      cmd_vdsoas_o_S = $(CC) $(a_flags) -c -o $@ $<
+
 # Strip rule for the raw .so files
 $(obj)/%.so.raw: OBJCOPYFLAGS := -S
 $(obj)/%.so.raw: $(obj)/%.so.dbg.raw FORCE
@@ -110,7 +113,7 @@ $(obj-vdso-o32): KBUILD_CFLAGS := $(cflags-vdso) -mabi=32
 $(obj-vdso-o32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=32
 
 $(obj)/%-o32.o: $(src)/%.S FORCE
-	$(call if_changed_dep,as_o_S)
+	$(call if_changed_dep,vdsoas_o_S)
 
 $(obj)/%-o32.o: $(src)/%.c FORCE
 	$(call cmd,force_checksrc)
@@ -150,7 +153,7 @@ $(obj-vdso-n32): KBUILD_CFLAGS := $(cflags-vdso) -mabi=n32
 $(obj-vdso-n32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=n32
 
 $(obj)/%-n32.o: $(src)/%.S FORCE
-	$(call if_changed_dep,as_o_S)
+	$(call if_changed_dep,vdsoas_o_S)
 
 $(obj)/%-n32.o: $(src)/%.c FORCE
 	$(call cmd,force_checksrc)
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 03/13] MIPS: 'make -s' should be silent Arnd Bergmann
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, Paul Burton, linux-kernel

vdso.h includes <spaces.h> implicitly after defining CONFIG_32BITS.
This defeats the override in mach-ip27/spaces.h, leading to
a build error that shows up in kernelci.org:

In file included from arch/mips/include/asm/mach-ip27/spaces.h:29:0,
                 from arch/mips/include/asm/page.h:12,
                 from arch/mips/vdso/vdso.h:26,
                 from arch/mips/vdso/gettimeofday.c:11:
arch/mips/include/asm/mach-generic/spaces.h:28:0: error: "CAC_BASE" redefined [-Werror]
 #define CAC_BASE  _AC(0x80000000, UL)

An earlier patch tried to make the second definition conditional,
but that patch had the #ifdef in the wrong place, and would lead
to another warning:

arch/mips/include/asm/io.h: In function 'phys_to_virt':
arch/mips/include/asm/io.h:138:9: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

For all I can tell, there is no other reason than vdso32 to ever
include this file with CONFIG_32BITS set, and the vdso itself should
never refer to the base addresses as it is running in user space,
so adding an #ifdef here is safe.

Link: https://patchwork.kernel.org/patch/9418187/
Fixes: 3ffc17d8768b ("MIPS: Adjust MIPS64 CAC_BASE to reflect Config.K0")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/include/asm/mach-ip27/spaces.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/mach-ip27/spaces.h b/arch/mips/include/asm/mach-ip27/spaces.h
index 4775a1136a5b..24d5e31bcfa6 100644
--- a/arch/mips/include/asm/mach-ip27/spaces.h
+++ b/arch/mips/include/asm/mach-ip27/spaces.h
@@ -12,14 +12,16 @@
 
 /*
  * IP27 uses the R10000's uncached attribute feature.  Attribute 3 selects
- * uncached memory addressing.
+ * uncached memory addressing. Hide the definitions on 32-bit compilation
+ * of the compat-vdso code.
  */
-
+#ifdef CONFIG_64BIT
 #define HSPEC_BASE		0x9000000000000000
 #define IO_BASE			0x9200000000000000
 #define MSPEC_BASE		0x9400000000000000
 #define UNCAC_BASE		0x9600000000000000
 #define CAC_BASE		0xa800000000000000
+#endif
 
 #define TO_MSPEC(x)		(MSPEC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_HSPEC(x)		(HSPEC_BASE | ((x) & TO_PHYS_MASK))
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 03/13] MIPS: 'make -s' should be silent
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, Paul Burton, Matt Redfearn,
	Huacai Chen, Maarten ter Huurne, linux-kernel

A clean mips64 build produces no output except for two lines:

  Checking missing-syscalls for N32
  Checking missing-syscalls for O32

On other architectures, there is no output at all, so let's do the
same here for the sake of build testing. The 'kecho' macro is used
to print the message on a normal build but skip it with 'make -s'.

Fixes: e48ce6b8df5b ("[MIPS] Simplify missing-syscalls for N32 and O32")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 06d79586368e..6ea306b28ae9 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -386,11 +386,11 @@ dtbs_install:
 
 archprepare:
 ifdef CONFIG_MIPS32_N32
-	@echo '  Checking missing-syscalls for N32'
+	@$(kecho) '  Checking missing-syscalls for N32'
 	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=n32"
 endif
 ifdef CONFIG_MIPS32_O32
-	@echo '  Checking missing-syscalls for O32'
+	@$(kecho) '  Checking missing-syscalls for O32'
 	$(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32"
 endif
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 04/13] MIPS: zboot: fix 'make clean' failure
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 03/13] MIPS: 'make -s' should be silent Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-18  9:43   ` Sergei Shtylyov
  2017-01-17 15:18 ` [PATCH 05/13] MIPS: alchemy: remove duplicate initializer Arnd Bergmann
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, Alban Bedel, Paul Bolle, Paul Burton,
	linux-kernel

The filter-out macro needs two arguments, passing only one is
clearly the result of a typo that leads to 'make clean' failing
on MIPS:

arch/mips/boot/compressed/Makefile:21: *** insufficient number of arguments (1) to function 'filter-out'.  Stop.

Fixes: afca036d463c ("MIPS: zboot: Consolidate compiler flag filtering.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/boot/compressed/Makefile | 2 +-
 arch/mips/include/asm/uaccess.h    | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
index 608389a4a418..c675eece389a 100644
--- a/arch/mips/boot/compressed/Makefile
+++ b/arch/mips/boot/compressed/Makefile
@@ -18,7 +18,7 @@ include $(srctree)/arch/mips/Kbuild.platforms
 BOOT_HEAP_SIZE := 0x400000
 
 # Disable Function Tracer
-KBUILD_CFLAGS := $(filter-out -pg $(KBUILD_CFLAGS))
+KBUILD_CFLAGS := $(filter-out -pg, $(KBUILD_CFLAGS))
 
 KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS))
 
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index 5347cfe15af2..c66db8169af9 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -80,6 +80,9 @@ extern u64 __ua_limit;
 
 #define segment_eq(a, b)	((a).seg == (b).seg)
 
+extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
+extern size_t __copy_user(void *__to, const void *__from, size_t __n);
+
 /*
  * eva_kernel_access() - determine whether kernel memory access on an EVA system
  *
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 05/13] MIPS: alchemy: remove duplicate initializer
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (2 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check Arnd Bergmann
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, linux-kernel

We get a harmless warning about a duplicate initalizer for the
i2c board info structure:

arch/mips/alchemy/board-gpr.c:239:11: error: initialized field overwritten [-Werror=override-init]

As both initializers have the identical value, we can simply drop
the second one.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/alchemy/board-gpr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c
index 79efe4c6e636..6fb6b3faa158 100644
--- a/arch/mips/alchemy/board-gpr.c
+++ b/arch/mips/alchemy/board-gpr.c
@@ -236,7 +236,6 @@ static struct platform_device gpr_i2c_device = {
 static struct i2c_board_info gpr_i2c_info[] __initdata = {
 	{
 		I2C_BOARD_INFO("lm83", 0x18),
-		.type = "lm83"
 	}
 };
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (3 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 05/13] MIPS: alchemy: remove duplicate initializer Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 07/13] MIPS: ralink: remove unused timer functions Arnd Bergmann
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, John Crispin, linux-kernel

Hauke already fixed a couple of them, but one instance remains
that checks for a negative integer when it should check
for a NULL pointer:

arch/mips/lantiq/xway/sysctrl.c: In function 'ltq_soc_init':
arch/mips/lantiq/xway/sysctrl.c:473:19: error: ordered comparison of pointer with integer zero [-Werror=extra]

Fixes: 6e807852676a ("MIPS: Lantiq: Fix check for return value of request_mem_region()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/lantiq/xway/sysctrl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
index 236193b5210b..ba9f358fa21b 100644
--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -469,8 +469,8 @@ void __init ltq_soc_init(void)
 			panic("Failed to load xbar nodes from devicetree");
 		if (of_address_to_resource(np_pmu, 0, &res_xbar))
 			panic("Failed to get xbar resources");
-		if (request_mem_region(res_xbar.start, resource_size(&res_xbar),
-			res_xbar.name) < 0)
+		if (!request_mem_region(res_xbar.start, resource_size(&res_xbar),
+			res_xbar.name))
 			panic("Failed to get xbar resources");
 
 		ltq_xbar_membase = ioremap_nocache(res_xbar.start,
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 07/13] MIPS: ralink: remove unused timer functions
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (4 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling Arnd Bergmann
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, Paul Gortmaker, John Crispin, linux-kernel

The functions were originally used for the module unload path,
but are not referenced any more and just cause warnings:

arch/mips/ralink/timer.c:104:13: error: 'rt_timer_disable' defined but not used [-Werror=unused-function]
arch/mips/ralink/timer.c:74:13: error: 'rt_timer_free' defined but not used [-Werror=unused-function]

Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Fixes: 62ee73d284e7 ("MIPS: ralink: Make timer explicitly non-modular")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/ralink/timer.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/arch/mips/ralink/timer.c b/arch/mips/ralink/timer.c
index 8077ff39bdea..d4469b20d176 100644
--- a/arch/mips/ralink/timer.c
+++ b/arch/mips/ralink/timer.c
@@ -71,11 +71,6 @@ static int rt_timer_request(struct rt_timer *rt)
 	return err;
 }
 
-static void rt_timer_free(struct rt_timer *rt)
-{
-	free_irq(rt->irq, rt);
-}
-
 static int rt_timer_config(struct rt_timer *rt, unsigned long divisor)
 {
 	if (rt->timer_freq < divisor)
@@ -101,15 +96,6 @@ static int rt_timer_enable(struct rt_timer *rt)
 	return 0;
 }
 
-static void rt_timer_disable(struct rt_timer *rt)
-{
-	u32 t;
-
-	t = rt_timer_r32(rt, TIMER_REG_TMR0CTL);
-	t &= ~TMR0CTL_ENABLE;
-	rt_timer_w32(rt, TIMER_REG_TMR0CTL, t);
-}
-
 static int rt_timer_probe(struct platform_device *pdev)
 {
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (5 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 07/13] MIPS: ralink: remove unused timer functions Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions Arnd Bergmann
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, John Crispin, Tobias Wolf, linux-kernel

request_mem_region returns a NULL pointer on error, comparing it
against a number results in a warning:

arch/mips/ralink/of.c: In function 'plat_of_remap_node':
arch/mips/ralink/of.c:45:15: error: ordered comparison of pointer with integer zero [-Werror=extra]
arch/mips/ralink/irq.c: In function 'intc_of_init':
arch/mips/ralink/irq.c:167:15: error: ordered comparison of pointer with integer zero [-Werror=extra]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/ralink/irq.c | 4 ++--
 arch/mips/ralink/of.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/ralink/irq.c b/arch/mips/ralink/irq.c
index 4911c1445f1a..9b478c95aaf5 100644
--- a/arch/mips/ralink/irq.c
+++ b/arch/mips/ralink/irq.c
@@ -163,8 +163,8 @@ static int __init intc_of_init(struct device_node *node,
 	if (of_address_to_resource(node, 0, &res))
 		panic("Failed to get intc memory range");
 
-	if (request_mem_region(res.start, resource_size(&res),
-				res.name) < 0)
+	if (!request_mem_region(res.start, resource_size(&res),
+				res.name))
 		pr_err("Failed to request intc memory");
 
 	rt_intc_membase = ioremap_nocache(res.start,
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 4c843e039b96..1ada8492733b 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -40,9 +40,9 @@ __iomem void *plat_of_remap_node(const char *node)
 	if (of_address_to_resource(np, 0, &res))
 		panic("Failed to get resource for %s", node);
 
-	if ((request_mem_region(res.start,
+	if (!request_mem_region(res.start,
 				resource_size(&res),
-				res.name) < 0))
+				res.name))
 		panic("Failed to request resources for %s", node);
 
 	return ioremap_nocache(res.start, resource_size(&res));
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (6 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc Arnd Bergmann
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, John Crispin, Colin Ian King, linux-kernel

All pointers to these functions were removed, so now they produce
warnings:

arch/mips/ralink/rt305x.c:92:13: error: 'rt305x_wdt_reset' defined but not used [-Werror=unused-function]

This removes the functions. If we need them again, the patch can be
reverted later.

Fixes: f576fb6a0700 ("MIPS: ralink: cleanup the soc specific pinmux data")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/ralink/rt288x.c | 10 ----------
 arch/mips/ralink/rt305x.c | 11 -----------
 arch/mips/ralink/rt3883.c | 10 ----------
 3 files changed, 31 deletions(-)

diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c
index eeabd5119891..40d3a69c7016 100644
--- a/arch/mips/ralink/rt288x.c
+++ b/arch/mips/ralink/rt288x.c
@@ -40,16 +40,6 @@ static struct rt2880_pmx_group rt2880_pinmux_data_act[] = {
 	{ 0 }
 };
 
-static void rt288x_wdt_reset(void)
-{
-	u32 t;
-
-	/* enable WDT reset output on pin SRAM_CS_N */
-	t = rt_sysc_r32(SYSC_REG_CLKCFG);
-	t |= CLKCFG_SRAM_CS_N_WDT;
-	rt_sysc_w32(t, SYSC_REG_CLKCFG);
-}
-
 void __init ralink_clk_init(void)
 {
 	unsigned long cpu_rate, wmac_rate = 40000000;
diff --git a/arch/mips/ralink/rt305x.c b/arch/mips/ralink/rt305x.c
index f0b5ac444556..01f7cd38d631 100644
--- a/arch/mips/ralink/rt305x.c
+++ b/arch/mips/ralink/rt305x.c
@@ -89,17 +89,6 @@ static struct rt2880_pmx_group rt5350_pinmux_data[] = {
 	{ 0 }
 };
 
-static void rt305x_wdt_reset(void)
-{
-	u32 t;
-
-	/* enable WDT reset output on pin SRAM_CS_N */
-	t = rt_sysc_r32(SYSC_REG_SYSTEM_CONFIG);
-	t |= RT305X_SYSCFG_SRAM_CS0_MODE_WDT <<
-		RT305X_SYSCFG_SRAM_CS0_MODE_SHIFT;
-	rt_sysc_w32(t, SYSC_REG_SYSTEM_CONFIG);
-}
-
 static unsigned long rt5350_get_mem_size(void)
 {
 	void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE);
diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c
index f869052e4a0d..252b64114b48 100644
--- a/arch/mips/ralink/rt3883.c
+++ b/arch/mips/ralink/rt3883.c
@@ -63,16 +63,6 @@ static struct rt2880_pmx_group rt3883_pinmux_data[] = {
 	{ 0 }
 };
 
-static void rt3883_wdt_reset(void)
-{
-	u32 t;
-
-	/* enable WDT reset output on GPIO 2 */
-	t = rt_sysc_r32(RT3883_SYSC_REG_SYSCFG1);
-	t |= RT3883_SYSCFG1_GPIO2_AS_WDT_OUT;
-	rt_sysc_w32(t, RT3883_SYSC_REG_SYSCFG1);
-}
-
 void __init ralink_clk_init(void)
 {
 	unsigned long cpu_rate, sys_rate;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (7 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning Arnd Bergmann
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, Robin Murphy, linux-kernel

A new gcc warning shows up for this old code with gcc-6:

arch/mips/loongson64/common/dma-swiotlb.c: In function 'loongson_dma_alloc_coherent':
arch/mips/loongson64/common/dma-swiotlb.c:35:2: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

The code can be easily restructured to look more readable
and avoid the warning at the same time.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/loongson64/common/dma-swiotlb.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/arch/mips/loongson64/common/dma-swiotlb.c b/arch/mips/loongson64/common/dma-swiotlb.c
index aab4fd681e1f..df7235e33499 100644
--- a/arch/mips/loongson64/common/dma-swiotlb.c
+++ b/arch/mips/loongson64/common/dma-swiotlb.c
@@ -17,22 +17,14 @@ static void *loongson_dma_alloc_coherent(struct device *dev, size_t size,
 	/* ignore region specifiers */
 	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ISA
-	if (dev == NULL)
+	if ((IS_ENABLED(CONFIG_ISA) && dev == NULL) ||
+	    (IS_ENABLED(CONFIG_ZONE_DMA) &&
+	     dev->coherent_dma_mask < DMA_BIT_MASK(32)))
 		gfp |= __GFP_DMA;
-	else
-#endif
-#ifdef CONFIG_ZONE_DMA
-	if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
-		gfp |= __GFP_DMA;
-	else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-	if (dev->coherent_dma_mask < DMA_BIT_MASK(40))
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		 dev->coherent_dma_mask < DMA_BIT_MASK(40))
 		gfp |= __GFP_DMA32;
-	else
-#endif
-	;
+
 	gfp |= __GFP_NORETRY;
 
 	ret = swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 11/13] MIPS: octeon: avoid empty-body warning
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (8 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 20:00   ` David Daney
  2017-01-17 15:18 ` [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 13/13] MIPS: avoid old-style declaration Arnd Bergmann
  11 siblings, 1 reply; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Arnd Bergmann, Hans-Christian Noren Egtvedt,
	Vineet Gupta, linux-kernel

gcc-6 reports a harmless build warning:

arch/mips/cavium-octeon/dma-octeon.c: In function 'octeon_dma_alloc_coherent':
arch/mips/cavium-octeon/dma-octeon.c:179:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

We can fix this by rearranging the code slightly using the
IS_ENABLED() macro.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/cavium-octeon/dma-octeon.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index fd69528b24fb..1226965e1e4f 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -164,19 +164,14 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
 	/* ignore region specifiers */
 	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ZONE_DMA
-	if (dev == NULL)
+	if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
 		gfp |= __GFP_DMA;
-	else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24))
+	else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+		 dev->coherent_dma_mask <= DMA_BIT_MASK(24))
 		gfp |= __GFP_DMA;
-	else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-	     if (dev->coherent_dma_mask <= DMA_BIT_MASK(32))
+	else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+		 dev->coherent_dma_mask <= DMA_BIT_MASK(32))
 		gfp |= __GFP_DMA32;
-	else
-#endif
-		;
 
 	/* Don't invoke OOM killer */
 	gfp |= __GFP_NORETRY;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (9 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  2017-01-17 15:18 ` [PATCH 13/13] MIPS: avoid old-style declaration Arnd Bergmann
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, linux-kernel

kernelci reports a failure of the ip28_defconfig build after upgrading its
gcc version:

arch/mips/sgi-ip22/Platform:29: *** gcc doesn't support needed option -mr10k-cache-barrier=store.  Stop.

The problem apparently is that the -mr10k-cache-barrier=store option is now
rejected for CPUs other than r10k. Explicitly including the CPU in the
check fixes this and is safe because both options were introduced in
gcc-4.4.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/sgi-ip22/Platform | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/sgi-ip22/Platform b/arch/mips/sgi-ip22/Platform
index b7a4b7e04c38..e8f6b3a42a48 100644
--- a/arch/mips/sgi-ip22/Platform
+++ b/arch/mips/sgi-ip22/Platform
@@ -25,7 +25,7 @@ endif
 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
 #
 ifdef CONFIG_SGI_IP28
-  ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n)
+  ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n)
       $(error gcc doesn't support needed option -mr10k-cache-barrier=store)
   endif
 endif
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 13/13] MIPS: avoid old-style declaration
  2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
                   ` (10 preceding siblings ...)
  2017-01-17 15:18 ` [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc Arnd Bergmann
@ 2017-01-17 15:18 ` Arnd Bergmann
  11 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-17 15:18 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Arnd Bergmann, linux-kernel

gcc warns about nonstandard declarations:

arch/mips/sgi-ip32/ip32-irq.c:31:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
arch/mips/sgi-ip32/ip32-irq.c:36:1: error: 'inline' is not at beginning of declaration [-Werror=old-style-declaration]
arch/mips/sgi-ip27/ip27-klnuma.c: In function 'replicate_kernel_text':
arch/mips/sgi-ip27/ip27-klnuma.c:85:116: error: old-style function definition [-Werror=old-style-definition]

Moving 'inline' before the return type, and adding argument types
shuts up the warning here. This patch affects several platforms,
but all in a trivial way. I'm fixing up all instances I found in
any of the 'defconfig' builds.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/emma/markeins/setup.c  | 2 +-
 arch/mips/netlogic/xlp/wakeup.c  | 2 +-
 arch/mips/sgi-ip27/ip27-klnuma.c | 2 +-
 arch/mips/sgi-ip32/ip32-irq.c    | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c
index 9100122e5cef..44ff64a80255 100644
--- a/arch/mips/emma/markeins/setup.c
+++ b/arch/mips/emma/markeins/setup.c
@@ -90,7 +90,7 @@ void __init plat_time_init(void)
 static void markeins_board_init(void);
 extern void markeins_irq_setup(void);
 
-static void inline __init markeins_sio_setup(void)
+static inline void __init markeins_sio_setup(void)
 {
 }
 
diff --git a/arch/mips/netlogic/xlp/wakeup.c b/arch/mips/netlogic/xlp/wakeup.c
index 87d7846af2d0..d61004dd71b4 100644
--- a/arch/mips/netlogic/xlp/wakeup.c
+++ b/arch/mips/netlogic/xlp/wakeup.c
@@ -197,7 +197,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
 	}
 }
 
-void xlp_wakeup_secondary_cpus()
+void xlp_wakeup_secondary_cpus(void)
 {
 	/*
 	 * In case of u-boot, the secondaries are in reset
diff --git a/arch/mips/sgi-ip27/ip27-klnuma.c b/arch/mips/sgi-ip27/ip27-klnuma.c
index bda90cf87e8c..2beb03907d09 100644
--- a/arch/mips/sgi-ip27/ip27-klnuma.c
+++ b/arch/mips/sgi-ip27/ip27-klnuma.c
@@ -82,7 +82,7 @@ static __init void copy_kernel(nasid_t dest_nasid)
 	memcpy((void *)dest_kern_start, (void *)source_start, kern_size);
 }
 
-void __init replicate_kernel_text()
+void __init replicate_kernel_text(void)
 {
 	cnodeid_t cnode;
 	nasid_t client_nasid;
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index e0c7d9e142fa..838d8589a1c0 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -28,12 +28,12 @@
 #include <asm/ip32/ip32_ints.h>
 
 /* issue a PIO read to make sure no PIO writes are pending */
-static void inline flush_crime_bus(void)
+static inline void flush_crime_bus(void)
 {
 	crime->control;
 }
 
-static void inline flush_mace_bus(void)
+static inline void flush_mace_bus(void)
 {
 	mace->perif.ctrl.misc;
 }
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 11/13] MIPS: octeon: avoid empty-body warning
  2017-01-17 15:18 ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning Arnd Bergmann
@ 2017-01-17 20:00   ` David Daney
  2017-01-17 20:00     ` David Daney
  0 siblings, 1 reply; 17+ messages in thread
From: David Daney @ 2017-01-17 20:00 UTC (permalink / raw)
  To: Arnd Bergmann, Ralf Baechle, Hill, Steven
  Cc: linux-mips, Hans-Christian Noren Egtvedt, Vineet Gupta, linux-kernel

On 01/17/2017 07:18 AM, Arnd Bergmann wrote:
> gcc-6 reports a harmless build warning:
>
> arch/mips/cavium-octeon/dma-octeon.c: In function 'octeon_dma_alloc_coherent':
> arch/mips/cavium-octeon/dma-octeon.c:179:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
>
> We can fix this by rearranging the code slightly using the
> IS_ENABLED() macro.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: David Daney <david.daney@cavium.com>

Steven: Please test this patch.


Thanks,
David Daney

> ---
>  arch/mips/cavium-octeon/dma-octeon.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
> index fd69528b24fb..1226965e1e4f 100644
> --- a/arch/mips/cavium-octeon/dma-octeon.c
> +++ b/arch/mips/cavium-octeon/dma-octeon.c
> @@ -164,19 +164,14 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
>  	/* ignore region specifiers */
>  	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
>
> -#ifdef CONFIG_ZONE_DMA
> -	if (dev == NULL)
> +	if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
>  		gfp |= __GFP_DMA;
> -	else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24))
> +	else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
> +		 dev->coherent_dma_mask <= DMA_BIT_MASK(24))
>  		gfp |= __GFP_DMA;
> -	else
> -#endif
> -#ifdef CONFIG_ZONE_DMA32
> -	     if (dev->coherent_dma_mask <= DMA_BIT_MASK(32))
> +	else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
> +		 dev->coherent_dma_mask <= DMA_BIT_MASK(32))
>  		gfp |= __GFP_DMA32;
> -	else
> -#endif
> -		;
>
>  	/* Don't invoke OOM killer */
>  	gfp |= __GFP_NORETRY;
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 11/13] MIPS: octeon: avoid empty-body warning
  2017-01-17 20:00   ` David Daney
@ 2017-01-17 20:00     ` David Daney
  0 siblings, 0 replies; 17+ messages in thread
From: David Daney @ 2017-01-17 20:00 UTC (permalink / raw)
  To: Arnd Bergmann, Ralf Baechle, Hill, Steven
  Cc: linux-mips, Hans-Christian Noren Egtvedt, Vineet Gupta, linux-kernel

On 01/17/2017 07:18 AM, Arnd Bergmann wrote:
> gcc-6 reports a harmless build warning:
>
> arch/mips/cavium-octeon/dma-octeon.c: In function 'octeon_dma_alloc_coherent':
> arch/mips/cavium-octeon/dma-octeon.c:179:3: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
>
> We can fix this by rearranging the code slightly using the
> IS_ENABLED() macro.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: David Daney <david.daney@cavium.com>

Steven: Please test this patch.


Thanks,
David Daney

> ---
>  arch/mips/cavium-octeon/dma-octeon.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
> index fd69528b24fb..1226965e1e4f 100644
> --- a/arch/mips/cavium-octeon/dma-octeon.c
> +++ b/arch/mips/cavium-octeon/dma-octeon.c
> @@ -164,19 +164,14 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
>  	/* ignore region specifiers */
>  	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
>
> -#ifdef CONFIG_ZONE_DMA
> -	if (dev == NULL)
> +	if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
>  		gfp |= __GFP_DMA;
> -	else if (dev->coherent_dma_mask <= DMA_BIT_MASK(24))
> +	else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
> +		 dev->coherent_dma_mask <= DMA_BIT_MASK(24))
>  		gfp |= __GFP_DMA;
> -	else
> -#endif
> -#ifdef CONFIG_ZONE_DMA32
> -	     if (dev->coherent_dma_mask <= DMA_BIT_MASK(32))
> +	else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
> +		 dev->coherent_dma_mask <= DMA_BIT_MASK(32))
>  		gfp |= __GFP_DMA32;
> -	else
> -#endif
> -		;
>
>  	/* Don't invoke OOM killer */
>  	gfp |= __GFP_NORETRY;
>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 04/13] MIPS: zboot: fix 'make clean' failure
  2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
@ 2017-01-18  9:43   ` Sergei Shtylyov
  2017-01-18  9:48     ` Arnd Bergmann
  0 siblings, 1 reply; 17+ messages in thread
From: Sergei Shtylyov @ 2017-01-18  9:43 UTC (permalink / raw)
  To: Arnd Bergmann, Ralf Baechle
  Cc: linux-mips, Alban Bedel, Paul Bolle, Paul Burton, linux-kernel

Hello!

On 1/17/2017 6:18 PM, Arnd Bergmann wrote:

> The filter-out macro needs two arguments, passing only one is
> clearly the result of a typo that leads to 'make clean' failing
> on MIPS:
>
> arch/mips/boot/compressed/Makefile:21: *** insufficient number of arguments (1) to function 'filter-out'.  Stop.
>
> Fixes: afca036d463c ("MIPS: zboot: Consolidate compiler flag filtering.")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[...]
> diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
> index 5347cfe15af2..c66db8169af9 100644
> --- a/arch/mips/include/asm/uaccess.h
> +++ b/arch/mips/include/asm/uaccess.h
> @@ -80,6 +80,9 @@ extern u64 __ua_limit;
>
>  #define segment_eq(a, b)	((a).seg == (b).seg)
>
> +extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
> +extern size_t __copy_user(void *__to, const void *__from, size_t __n);
> +
>  /*
>   * eva_kernel_access() - determine whether kernel memory access on an EVA system
>   *

    Unrelated change?

MBR, Sergei

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 04/13] MIPS: zboot: fix 'make clean' failure
  2017-01-18  9:43   ` Sergei Shtylyov
@ 2017-01-18  9:48     ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2017-01-18  9:48 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Ralf Baechle, linux-mips, Alban Bedel, Paul Bolle, Paul Burton,
	Linux Kernel Mailing List

On Wed, Jan 18, 2017 at 10:43 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 1/17/2017 6:18 PM, Arnd Bergmann wrote:
>> diff --git a/arch/mips/include/asm/uaccess.h
>> b/arch/mips/include/asm/uaccess.h
>> index 5347cfe15af2..c66db8169af9 100644
>> --- a/arch/mips/include/asm/uaccess.h
>> +++ b/arch/mips/include/asm/uaccess.h
>> @@ -80,6 +80,9 @@ extern u64 __ua_limit;
>>
>>  #define segment_eq(a, b)       ((a).seg == (b).seg)
>>
>> +extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t
>> __n);
>> +extern size_t __copy_user(void *__to, const void *__from, size_t __n);
>> +
>>  /*
>>   * eva_kernel_access() - determine whether kernel memory access on an EVA
>> system
>>   *
>
>
>    Unrelated change?

Sorry, my mistake. That was meant to be part of "MIPS: Fix
modversions". I'll send this separately once the kernelci bot has some
results for today's linux-next.

    Arnd

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-01-18  9:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-17 15:18 [PATCH 01/13] MIPS: fix modversions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 02/13] MIPS: VDSO: avoid duplicate CAC_BASE definition Arnd Bergmann
2017-01-17 15:18 ` [PATCH 03/13] MIPS: 'make -s' should be silent Arnd Bergmann
2017-01-17 15:18 ` [PATCH 04/13] MIPS: zboot: fix 'make clean' failure Arnd Bergmann
2017-01-18  9:43   ` Sergei Shtylyov
2017-01-18  9:48     ` Arnd Bergmann
2017-01-17 15:18 ` [PATCH 05/13] MIPS: alchemy: remove duplicate initializer Arnd Bergmann
2017-01-17 15:18 ` [PATCH 06/13] MIPS: Lantiq: Fix another request_mem_region() return code check Arnd Bergmann
2017-01-17 15:18 ` [PATCH 07/13] MIPS: ralink: remove unused timer functions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 08/13] MIPS: ralink: fix request_mem_region error handling Arnd Bergmann
2017-01-17 15:18 ` [PATCH 09/13] MIPS: ralink: remove unused rt*_wdt_reset functions Arnd Bergmann
2017-01-17 15:18 ` [PATCH 10/13] MIPS: loongson64: fix empty-body warning in dma_alloc Arnd Bergmann
2017-01-17 15:18 ` [PATCH 11/13] MIPS: octeon: avoid empty-body warning Arnd Bergmann
2017-01-17 20:00   ` David Daney
2017-01-17 20:00     ` David Daney
2017-01-17 15:18 ` [PATCH 12/13] MIPS: ip22: fix ip28 build for modern gcc Arnd Bergmann
2017-01-17 15:18 ` [PATCH 13/13] MIPS: avoid old-style declaration Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).