[PATCH] score/chain: Fix _Chain_Is_first and _Chain_Is_last

Gedare Bloom gedare at rtems.org
Wed Jan 10 14:47:26 UTC 2018


I'm applying this fix to 4.10.  It was fixed in 4.11 about 5 years
ago, but wasn't back-ported.

On Wed, Jan 10, 2018 at 9:44 AM, Gedare Bloom <gedare at rtems.org> wrote:
> Updates #1964.
> ---
>  cpukit/score/inline/rtems/score/chain.inl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cpukit/score/inline/rtems/score/chain.inl b/cpukit/score/inline/rtems/score/chain.inl
> index 3bde7fb..1991415 100644
> --- a/cpukit/score/inline/rtems/score/chain.inl
> +++ b/cpukit/score/inline/rtems/score/chain.inl
> @@ -235,7 +235,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_first(
>    const Chain_Node *the_node
>  )
>  {
> -  return (the_node->previous == NULL);
> +  return (the_node->previous->previous == NULL);
>  }
>
>  /** @brief Is this the Last Node on the Chain
> @@ -252,7 +252,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_last(
>    const Chain_Node *the_node
>  )
>  {
> -  return (the_node->next == NULL);
> +  return (the_node->next->next == NULL);
>  }
>
>  /** @brief Does this Chain have only One Node
> --
> 2.7.4
>



More information about the devel mailing list