summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-13 13:47:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-14 18:10:50 +0200
commit3972085dbab9b05e839b2612abf625c6097a180b (patch)
tree6ffb806aab62a1e0bc809bf67de8d39d2776f0d4
parentdf9cc1aee87da6c6ba41d52454fa5f45fba74501 (diff)
Remove *_Is_null() inline functions
Simply compare the values against NULL.
-rw-r--r--cpukit/include/rtems/chain.h2
-rw-r--r--cpukit/include/rtems/rtems/asrimpl.h13
-rw-r--r--cpukit/include/rtems/score/chainimpl.h17
-rw-r--r--cpukit/include/rtems/score/objectmp.h15
-rw-r--r--cpukit/include/rtems/score/threadimpl.h15
-rw-r--r--cpukit/rtems/src/msgmp.c5
-rw-r--r--cpukit/rtems/src/partmp.c5
-rw-r--r--cpukit/rtems/src/semmp.c3
-rw-r--r--cpukit/rtems/src/signalcatch.c2
-rw-r--r--cpukit/rtems/src/signalsend.c2
-rw-r--r--cpukit/rtems/src/taskconstruct.c2
-rw-r--r--cpukit/score/src/objectmp.c7
12 files changed, 16 insertions, 72 deletions
diff --git a/cpukit/include/rtems/chain.h b/cpukit/include/rtems/chain.h
index 11ebdca322..25ea0b23b7 100644
--- a/cpukit/include/rtems/chain.h
+++ b/cpukit/include/rtems/chain.h
@@ -234,7 +234,7 @@ RTEMS_INLINE_ROUTINE bool rtems_chain_is_null_node(
const rtems_chain_node *the_node
)
{
- return _Chain_Is_null_node( the_node );
+ return the_node == NULL;
}
/**
diff --git a/cpukit/include/rtems/rtems/asrimpl.h b/cpukit/include/rtems/rtems/asrimpl.h
index 8e8efe5de5..90910cabc4 100644
--- a/cpukit/include/rtems/rtems/asrimpl.h
+++ b/cpukit/include/rtems/rtems/asrimpl.h
@@ -45,19 +45,6 @@ RTEMS_INLINE_ROUTINE void _ASR_Initialize (
memset(asr, 0, sizeof(*asr));
}
-/**
- * @brief ASR_Is_null_handler
- *
- * This function returns TRUE if the given asr_handler is NULL and
- * FALSE otherwise.
- */
-RTEMS_INLINE_ROUTINE bool _ASR_Is_null_handler (
- rtems_asr_entry asr_handler
-)
-{
- return asr_handler == NULL;
-}
-
RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Swap_signals( ASR_Information *asr )
{
rtems_signal_set new_signals_posted;
diff --git a/cpukit/include/rtems/score/chainimpl.h b/cpukit/include/rtems/score/chainimpl.h
index 15bce3668c..2d78c4ec6d 100644
--- a/cpukit/include/rtems/score/chainimpl.h
+++ b/cpukit/include/rtems/score/chainimpl.h
@@ -167,23 +167,6 @@ RTEMS_INLINE_ROUTINE bool _Chain_Are_nodes_equal(
}
/**
- * @brief Checks if the chain node pointer is NULL.
- *
- * This function returns true if the_node is NULL and false otherwise.
- *
- * @param the_node The node pointer to check.
- *
- * @retval true @a the_node is @c NULL.
- * @retval false @a the_node is not @c NULL.
- */
-RTEMS_INLINE_ROUTINE bool _Chain_Is_null_node(
- const Chain_Node *the_node
-)
-{
- return (the_node == NULL);
-}
-
-/**
* @brief Returns pointer to chain head.
*
* This function returns a pointer to the head node on the chain.
diff --git a/cpukit/include/rtems/score/objectmp.h b/cpukit/include/rtems/score/objectmp.h
index c2621c3857..74a01de1a7 100644
--- a/cpukit/include/rtems/score/objectmp.h
+++ b/cpukit/include/rtems/score/objectmp.h
@@ -190,21 +190,6 @@ Objects_MP_Control *_Objects_MP_Allocate_global_object( void );
*/
void _Objects_MP_Free_global_object( Objects_MP_Control *the_object );
-/**
- * @brief Checks if the global object is NULL or not.
- *
- * @param the_object The object to check if it is NULL.
- *
- * @retval true @a the_object is NULL.
- * @retval false @a the_object is not NULL.
- */
-RTEMS_INLINE_ROUTINE bool _Objects_MP_Is_null_global_object (
- Objects_MP_Control *the_object
-)
-{
- return( the_object == NULL );
-}
-
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/rtems/score/threadimpl.h b/cpukit/include/rtems/score/threadimpl.h
index a2e1e1427c..9468d64df0 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -1072,21 +1072,6 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_context_switch_necessary( void )
}
/**
- * @brief Checks if the thread is NULL.
- *
- * @param the_thread The thread for the verification.
- *
- * @retval true The thread is @c NULL.
- * @retval false The thread is not @c NULL.
- */
-RTEMS_INLINE_ROUTINE bool _Thread_Is_null (
- const Thread_Control *the_thread
-)
-{
- return ( the_thread == NULL );
-}
-
-/**
* @brief Gets the maximum number of internal threads.
*
* @return The maximum number of internal threads.
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index ae7c9802e2..9847cbd569 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -397,8 +397,9 @@ static void _Message_queue_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
- if (! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread );
+ if ( the_thread != NULL ) {
+ _Thread_queue_Extract( the_thread );
+ }
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index ac2b48aba4..99af7adf71 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -242,8 +242,9 @@ static void _Partition_MP_Process_packet(
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
- if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread );
+ if ( the_thread != NULL ) {
+ _Thread_queue_Extract( the_thread );
+ }
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
index 9b169a8e8f..849bb6e84a 100644
--- a/cpukit/rtems/src/semmp.c
+++ b/cpukit/rtems/src/semmp.c
@@ -222,8 +222,9 @@ static void _Semaphore_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
- if ( ! _Thread_Is_null( the_thread ) )
+ if ( the_thread != NULL ) {
_Thread_queue_Extract( the_thread );
+ }
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index f282314a31..5ace9642fb 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -77,7 +77,7 @@ rtems_status_code rtems_signal_catch(
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
- if ( !_ASR_Is_null_handler( asr_handler ) ) {
+ if ( asr_handler != NULL ) {
asr->mode_set = mode_set;
asr->handler = asr_handler;
} else {
diff --git a/cpukit/rtems/src/signalsend.c b/cpukit/rtems/src/signalsend.c
index 36e23660a9..ea649da57f 100644
--- a/cpukit/rtems/src/signalsend.c
+++ b/cpukit/rtems/src/signalsend.c
@@ -53,7 +53,7 @@ rtems_status_code rtems_signal_send(
_Thread_State_acquire_critical( the_thread, &lock_context );
- if ( _ASR_Is_null_handler( asr->handler ) ) {
+ if ( asr->handler == NULL ) {
_Thread_State_release( the_thread, &lock_context );
return RTEMS_NOT_DEFINED;
}
diff --git a/cpukit/rtems/src/taskconstruct.c b/cpukit/rtems/src/taskconstruct.c
index 9b1fdec3ae..84e59552c6 100644
--- a/cpukit/rtems/src/taskconstruct.c
+++ b/cpukit/rtems/src/taskconstruct.c
@@ -180,7 +180,7 @@ rtems_status_code _RTEMS_tasks_Create(
if ( is_global ) {
the_global_object = _Objects_MP_Allocate_global_object();
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
+ if ( the_global_object == NULL ) {
_RTEMS_tasks_Free( the_thread );
_Objects_Allocator_unlock();
return RTEMS_TOO_MANY;
diff --git a/cpukit/score/src/objectmp.c b/cpukit/score/src/objectmp.c
index 74d55305a9..612fdacca0 100644
--- a/cpukit/score/src/objectmp.c
+++ b/cpukit/score/src/objectmp.c
@@ -231,13 +231,14 @@ bool _Objects_MP_Allocate_and_open (
bool is_fatal_error
)
{
- Objects_MP_Control *the_global_object;
+ Objects_MP_Control *the_global_object;
the_global_object = _Objects_MP_Allocate_global_object();
- if ( _Objects_MP_Is_null_global_object( the_global_object ) ) {
- if ( is_fatal_error == false )
+ if ( the_global_object == NULL ) {
+ if ( !is_fatal_error ) {
return false;
+ }
_Internal_error( INTERNAL_ERROR_OUT_OF_GLOBAL_OBJECTS );
}