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/ChangeLog | 5 +++++ cpukit/score/cpu/lm32/rtems/score/cpu.h | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'cpukit') diff --git a/cpukit/score/cpu/lm32/ChangeLog b/cpukit/score/cpu/lm32/ChangeLog index 0ebc24173d..bded968ea0 100644 --- a/cpukit/score/cpu/lm32/ChangeLog +++ b/cpukit/score/cpu/lm32/ChangeLog @@ -1,3 +1,8 @@ +2011-11-09 Werner Almesberger + + PR 1955/cpukit + * rtems/score/cpu.h: Convert CPU_swap_u16 into a static inline. + 2011-09-27 Sebastian Huber PR 1914/cpukit 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