[PATCH] score: Simplify _Addresses_Is_aligned()

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jan 14 06:51:19 UTC 2019


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 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;
 }
 
 /**
-- 
2.16.4



More information about the devel mailing list