Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1228f7be authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

s390: add missing "do {} while (0)" loop constructs to multiline macros

parent 549f2bf5
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -9,7 +9,7 @@


#include <linux/bug.h>
#include <linux/bug.h>


#define __ctl_load(array, low, high) {					\
#define __ctl_load(array, low, high) do {				\
	typedef struct { char _[sizeof(array)]; } addrtype;		\
	typedef struct { char _[sizeof(array)]; } addrtype;		\
									\
									\
	BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
	BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
@@ -18,9 +18,9 @@
		:							\
		:							\
		: "Q" (*(addrtype *)(&array)), "i" (low), "i" (high)	\
		: "Q" (*(addrtype *)(&array)), "i" (low), "i" (high)	\
		: "memory");						\
		: "memory");						\
}
} while (0)


#define __ctl_store(array, low, high) {					\
#define __ctl_store(array, low, high) do {				\
	typedef struct { char _[sizeof(array)]; } addrtype;		\
	typedef struct { char _[sizeof(array)]; } addrtype;		\
									\
									\
	BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
	BUILD_BUG_ON(sizeof(addrtype) != (high - low + 1) * sizeof(long));\
@@ -28,7 +28,7 @@
		"	stctg	%1,%2,%0\n"				\
		"	stctg	%1,%2,%0\n"				\
		: "=Q" (*(addrtype *)(&array))				\
		: "=Q" (*(addrtype *)(&array))				\
		: "i" (low), "i" (high));				\
		: "i" (low), "i" (high));				\
}
} while (0)


static inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
static inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
{
{
+2 −2
Original line number Original line Diff line number Diff line
@@ -358,12 +358,12 @@ extern void (*s390_base_ext_handler_fn)(void);
extern int memcpy_real(void *, void *, size_t);
extern int memcpy_real(void *, void *, size_t);
extern void memcpy_absolute(void *, void *, size_t);
extern void memcpy_absolute(void *, void *, size_t);


#define mem_assign_absolute(dest, val) {			\
#define mem_assign_absolute(dest, val) do {			\
	__typeof__(dest) __tmp = (val);				\
	__typeof__(dest) __tmp = (val);				\
								\
								\
	BUILD_BUG_ON(sizeof(__tmp) != sizeof(val));		\
	BUILD_BUG_ON(sizeof(__tmp) != sizeof(val));		\
	memcpy_absolute(&(dest), &__tmp, sizeof(__tmp));	\
	memcpy_absolute(&(dest), &__tmp, sizeof(__tmp));	\
}
} while (0)


#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLY__ */


+2 −2
Original line number Original line Diff line number Diff line
@@ -38,13 +38,13 @@
#define get_fs()        (current->thread.mm_segment)
#define get_fs()        (current->thread.mm_segment)


#define set_fs(x)							\
#define set_fs(x)							\
{									\
do {									\
	unsigned long __pto;						\
	unsigned long __pto;						\
	current->thread.mm_segment = (x);				\
	current->thread.mm_segment = (x);				\
	__pto = current->thread.mm_segment.ar4 ?			\
	__pto = current->thread.mm_segment.ar4 ?			\
		S390_lowcore.user_asce : S390_lowcore.kernel_asce;	\
		S390_lowcore.user_asce : S390_lowcore.kernel_asce;	\
	__ctl_load(__pto, 7, 7);					\
	__ctl_load(__pto, 7, 7);					\
}
} while (0)


#define segment_eq(a,b) ((a).ar4 == (b).ar4)
#define segment_eq(a,b) ((a).ar4 == (b).ar4)