From 552a80fcbca96ae2807ea9797184c7832cfc4345 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Nov 2011 15:15:25 +0000 Subject: 2011-11-09 Werner Almesberger PR 1955/cpukit * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline. --- cpukit/score/cpu/lm32/rtems/score/cpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cpukit/score/cpu/lm32/rtems/score/cpu.h') diff --git a/cpukit/score/cpu/lm32/rtems/score/cpu.h b/cpukit/score/cpu/lm32/rtems/score/cpu.h index 3a7b9f3fa7..3db80013ee 100644 --- a/cpukit/score/cpu/lm32/rtems/score/cpu.h +++ b/cpukit/score/cpu/lm32/rtems/score/cpu.h @@ -1258,8 +1258,10 @@ static inline uint32_t CPU_swap_u32( * @param[in] value is the value to be swapped * @return the value after being endian swapped */ -#define CPU_swap_u16( value ) \ - (((value&0xff) << 8) | ((value >> 8)&0xff)) +static inline uint16_t CPU_swap_u16(uint16_t v) +{ + return v << 8 | v >> 8; +} #ifdef __cplusplus } -- cgit v1.2.3