[PATCH 12/20] rtems: Move _Partition_Is_buffer_size_aligned()

Gedare Bloom gedare at rtems.org
Fri Nov 20 16:15:20 UTC 2020


On Fri, Nov 20, 2020 at 4:16 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> It is only used by rtems_partition_create().  Fix integer type.
> ---
>  cpukit/include/rtems/rtems/partimpl.h | 7 -------
>  cpukit/rtems/src/partcreate.c         | 5 +++++
>  2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h
> index 0d15d1e991..b9d57ae3c3 100644
> --- a/cpukit/include/rtems/rtems/partimpl.h
> +++ b/cpukit/include/rtems/rtems/partimpl.h
> @@ -34,13 +34,6 @@ extern "C" {
>   * @{
>   */
>
> -RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned(
> -  uint32_t buffer_size
> -)
> -{
> -  return (buffer_size % CPU_SIZEOF_POINTER) == 0;
> -}
> -
>  RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_area_aligned(
>    const void *starting_address
>  )
> diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
> index 9d4c7df283..6673ce2c59 100644
> --- a/cpukit/rtems/src/partcreate.c
> +++ b/cpukit/rtems/src/partcreate.c
> @@ -26,6 +26,11 @@
>  #include <rtems/score/sysstate.h>
>  #include <rtems/sysinit.h>
>
> +static bool _Partition_Is_buffer_size_aligned( size_t buffer_size )

Nit: I never saw this before, but this isn't what "aligned" means.
Aligned means you start something at a specific multiple. This is
checking if the buffer_size is a multiple of the pointer size. Anyway,
it is just used here so it's fine, but maybe just a one-line comment
that buffer sizes are required to be a multiple of the pointer size.

> +{
> +  return ( buffer_size % CPU_SIZEOF_POINTER ) == 0;
> +}
> +
>  rtems_status_code rtems_partition_create(
>    rtems_name       name,
>    void            *starting_address,
> --
> 2.26.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list