[PATCH] Fix compiler warnings for schedulerstrongapa.c

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 5 05:39:05 UTC 2021


On 03/07/2021 09:06, Richi Dubey wrote:
> ---
>   cpukit/score/src/schedulerstrongapa.c | 21 ++++++++++++++++-----
>   1 file changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
> index 845d19d1a8..b34ffe4b6d 100644
> --- a/cpukit/score/src/schedulerstrongapa.c
> +++ b/cpukit/score/src/schedulerstrongapa.c
> @@ -187,7 +187,7 @@ static inline Scheduler_Node * _Scheduler_strong_APA_Find_highest_ready(
>     uint32_t                      rear
>   )
>   {
> -  Scheduler_Node              *highest_ready;
> +  Scheduler_Node              *highest_ready = NULL;
>     Scheduler_strong_APA_CPU    *CPU;
>     const Chain_Node            *tail;
>     Chain_Node                  *next;
> @@ -259,6 +259,10 @@ static inline Scheduler_Node * _Scheduler_strong_APA_Find_highest_ready(
>       }
>     }
>   
> +  /*
> +   * By definition, the system would always have a ready node,
> +   * hence highest_ready would not be NULL.
> +   */
>     return highest_ready;

Could you please add an _Assert( highest_ready != NULL ) statement here 
and also to the following parts.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list