forked from Imagelibrary/rtems
rtems: Move _Partition_Is_buffer_size_aligned()
It is only used by rtems_partition_create(). Move code directly into the directive which called the inline function. Add a comment.
This commit is contained in:
@@ -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(
|
RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_area_aligned(
|
||||||
const void *starting_address
|
const void *starting_address
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -58,8 +58,13 @@ rtems_status_code rtems_partition_create(
|
|||||||
if ( length < buffer_size )
|
if ( length < buffer_size )
|
||||||
return RTEMS_INVALID_SIZE;
|
return RTEMS_INVALID_SIZE;
|
||||||
|
|
||||||
if ( !_Partition_Is_buffer_size_aligned( buffer_size ) )
|
/*
|
||||||
|
* Ensure that the buffer size is an integral multiple of the pointer size so
|
||||||
|
* that each buffer begin meets the chain node alignment.
|
||||||
|
*/
|
||||||
|
if ( buffer_size % CPU_SIZEOF_POINTER != 0 ) {
|
||||||
return RTEMS_INVALID_SIZE;
|
return RTEMS_INVALID_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
if ( buffer_size < sizeof( Chain_Node ) )
|
if ( buffer_size < sizeof( Chain_Node ) )
|
||||||
return RTEMS_INVALID_SIZE;
|
return RTEMS_INVALID_SIZE;
|
||||||
|
|||||||
Reference in New Issue
Block a user