[PATCH v2 07/13] score: Simplify casts

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Oct 6 08:23:26 UTC 2022


---
 cpukit/include/rtems/score/tls.h | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/cpukit/include/rtems/score/tls.h b/cpukit/include/rtems/score/tls.h
index 9c90b6362b..abb0a748ad 100644
--- a/cpukit/include/rtems/score/tls.h
+++ b/cpukit/include/rtems/score/tls.h
@@ -167,17 +167,13 @@ uintptr_t _TLS_Get_allocation_size( void );
  */
 static inline void _TLS_Copy_and_clear( void *tls_data )
 {
-  tls_data = memcpy(
-    tls_data,
-    _TLS_Data_begin,
-    (size_t) ((uintptr_t)_TLS_Data_size)
-  );
+  tls_data = memcpy( tls_data, _TLS_Data_begin, (uintptr_t) _TLS_Data_size );
 
   memset(
-    (char *) tls_data + (size_t)((intptr_t) _TLS_BSS_begin) -
-      (size_t)((intptr_t) _TLS_Data_begin),
+    (char *) tls_data +
+      (uintptr_t) _TLS_BSS_begin - (uintptr_t) _TLS_Data_begin,
     0,
-    ((size_t) (intptr_t)_TLS_BSS_size)
+    (uintptr_t) _TLS_BSS_size
   );
 }
 
-- 
2.35.3



More information about the devel mailing list