[PATCH] improved error checking in ticks per timeslice

Joel Sherrill joel at rtems.org
Wed Feb 14 14:18:47 UTC 2024


I'm cc'ing Sebastian because you edited the text in a generated file. He
should be able to point us to the right place to fix it.

On Mon, Feb 12, 2024 at 8:26 PM <zakthertemsdev at gmail.com> wrote:

> From: Zack leung <z.liang111 at gmail.com>
>
> diff --git a/cpukit/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
> index bd7cde628f..d480eb3971 100644
> --- a/cpukit/doxygen/appl-config.h
> +++ b/cpukit/doxygen/appl-config.h
> @@ -3312,7 +3312,7 @@
>   * @parblock
>   * The following constraints apply to this configuration option:
>   *
> - * * The value of the configuration option shall be greater than or equal
> to
> + * * The value of the configuration option shall be greater than
>   *   zero.
>


This file is generated from something in rtems-central. This was at the top
of the file:

 * This file is part of the RTEMS quality process and was automatically
 * generated.  If you find something that needs to be fixed or
 * worded better please post a report or patch to an RTEMS mailing list



>   *
>   * * The value of the configuration option shall be less than or equal to
> <a
> diff --git a/cpukit/include/rtems/confdefs/clock.h
> b/cpukit/include/rtems/confdefs/clock.h
> index 26519cc70b..d0d7c453bc 100644
> --- a/cpukit/include/rtems/confdefs/clock.h
> +++ b/cpukit/include/rtems/confdefs/clock.h
> @@ -74,6 +74,10 @@
>    #error "CONFIGURE_MICROSECONDS_PER_TICK must be positive"
>  #endif
>
> +#if CONFIGURE_TICKS_PER_TIMESLICE <= 0 &&
> defined(CONFIGURE_TICKS_PER_TIMESLICE)
> +  #error "CONFIGURE_TICKS_PER_TIMESLICE shall be greater than zero"
> +#endif
> +
>

This is modifying the right file but I think it is safer to check that it
is defined
before checking its value.

--joel


>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> --
> 2.43.0
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20240214/f857b1e0/attachment.htm>


More information about the devel mailing list