Skip to content

Commit

Permalink
s390: add missing "do {} while (0)" loop constructs to multiline macros
Browse files Browse the repository at this point in the history
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Feb 17, 2017
1 parent 549f2bf commit 1228f7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions arch/s390/include/asm/ctl_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <linux/bug.h>

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

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

static inline void __ctl_set_bit(unsigned int cr, unsigned int bit)
{
Expand Down
4 changes: 2 additions & 2 deletions arch/s390/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ extern void (*s390_base_ext_handler_fn)(void);
extern int memcpy_real(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); \
\
BUILD_BUG_ON(sizeof(__tmp) != sizeof(val)); \
memcpy_absolute(&(dest), &__tmp, sizeof(__tmp)); \
}
} while (0)

#endif /* __ASSEMBLY__ */

Expand Down
4 changes: 2 additions & 2 deletions arch/s390/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
#define get_fs() (current->thread.mm_segment)

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

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

Expand Down

0 comments on commit 1228f7b

Please sign in to comment.