[PATCH 12/20] rtems: Move _Partition_Is_buffer_size_aligned()
Gedare Bloom
gedare at rtems.org
Fri Nov 20 16:45:21 UTC 2020
On Fri, Nov 20, 2020 at 9:28 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> On 20/11/2020 17:15, Gedare Bloom wrote:
>
> >> +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.
> >
> I think in this case we should review the documentation. If the function
> name is irritating, then we should remove it. It is only called in one
> place. So change
>
> if ( !_Partition_Is_buffer_size_aligned( buffer_size ) )
> return RTEMS_INVALID_SIZE;
>
> to
>
>
> if ( ( buffer_size % CPU_SIZEOF_POINTER ) != 0 )
> return RTEMS_INVALID_SIZE;
>
that would be fine by me. I'm fairly certain the manual already covers
this requirement.
> --
> embedded brains GmbH
> 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
> PGP: Public key available on request.
>
> embedded brains GmbH
> 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