summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/lm32/rtems/score/cpu.h
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-11-09 15:15:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-11-09 15:15:25 +0000
commit552a80fcbca96ae2807ea9797184c7832cfc4345 (patch)
tree442ac8972b0b7e18fd9df0603dbf9abef951196c /cpukit/score/cpu/lm32/rtems/score/cpu.h
parent2011-11-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-552a80fcbca96ae2807ea9797184c7832cfc4345.tar.bz2
2011-11-09 Werner Almesberger <werner@almesberger.net>
PR 1955/cpukit * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline.
Diffstat (limited to 'cpukit/score/cpu/lm32/rtems/score/cpu.h')
-rw-r--r--cpukit/score/cpu/lm32/rtems/score/cpu.h6
1 files changed, 4 insertions, 2 deletions
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
}