[rtems commit] score: Simplify _Addresses_Is_aligned()
Sebastian Huber
sebh at rtems.org
Fri Jan 18 10:51:07 UTC 2019
Module: rtems
Branch: master
Commit: 93e3b3416131acd566000094d3cf81b7a1e11f69
Changeset: http://git.rtems.org/rtems/commit/?id=93e3b3416131acd566000094d3cf81b7a1e11f69
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Jan 14 07:50:26 2019 +0100
score: Simplify _Addresses_Is_aligned()
The CPU_ALIGNMENT must not be zero, this is also checked via a static
assertion. Fix formatting.
---
cpukit/include/rtems/score/address.h | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/cpukit/include/rtems/score/address.h b/cpukit/include/rtems/score/address.h
index fb88230..00fc105 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;
}
/**
More information about the vc
mailing list