summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-01-14 07:50:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-01-18 11:49:09 +0100
commit93e3b3416131acd566000094d3cf81b7a1e11f69 (patch)
tree83d1cd07486c5f7ef030cf87e238ad6ed5e3c668
parentbsps/i386/shared/cache/cache.c: Make compile (diff)
downloadrtems-93e3b3416131acd566000094d3cf81b7a1e11f69.tar.bz2
score: Simplify _Addresses_Is_aligned()
The CPU_ALIGNMENT must not be zero, this is also checked via a static assertion. Fix formatting.
-rw-r--r--cpukit/include/rtems/score/address.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/cpukit/include/rtems/score/address.h b/cpukit/include/rtems/score/address.h
index fb88230d18..00fc105e48 100644
--- a/cpukit/include/rtems/score/address.h
+++ b/cpukit/include/rtems/score/address.h
@@ -107,15 +107,11 @@ RTEMS_INLINE_ROUTINE intptr_t _Addresses_Subtract(
* @retval true The @a address is aligned.
* @retval false The @a address is not aligned.
*/
-RTEMS_INLINE_ROUTINE bool _Addresses_Is_aligned (
+RTEMS_INLINE_ROUTINE bool _Addresses_Is_aligned(
const void *address
)
{
-#if (CPU_ALIGNMENT == 0)
- return true;
-#else
- return (((uintptr_t)address % CPU_ALIGNMENT) == 0);
-#endif
+ return ( (uintptr_t) address % CPU_ALIGNMENT ) == 0;
}
/**