Skip to content

Commit 9b6a629

Browse files
committed
alloc: (cosmetic) simplify comments and fix indentation
Update and simplify Doxygen comments for SOF_MEM_FLAG_* flags, update an outdated comment about memory zones, fix indentation and merge a needlessly split line. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 1b5294d commit 9b6a629

3 files changed

Lines changed: 21 additions & 22 deletions

File tree

posix/include/rtos/alloc.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@
3838
* the first two positions are reserved for SOF_BUF_ flags
3939
*/
4040

41-
/** \brief Indicates we should return DMA-able memory. */
41+
/** \brief Allocate DMA-able memory. */
4242
#define SOF_MEM_FLAG_DMA BIT(2)
43-
/** \brief Indicates that original content should not be copied by realloc. */
43+
/** \brief realloc() skips copying the original content. */
4444
#define SOF_MEM_FLAG_NO_COPY BIT(3)
45-
/** \brief Indicates that if we should return uncached address. */
45+
/** \brief Allocate uncached address. */
4646
#define SOF_MEM_FLAG_COHERENT BIT(4)
47-
/** \brief Indicates that if we should return L3 address. */
47+
/** \brief Allocate L3 address. */
4848
#define SOF_MEM_FLAG_L3 BIT(5)
49-
/** \brief Indicates that if we should return Low power memory address. */
49+
/** \brief Allocate Low power memory address. */
5050
#define SOF_MEM_FLAG_LOW_POWER BIT(6)
51-
/** \brief Indicates that if we should return kernel memory address. */
51+
/** \brief Allocate kernel memory address. */
5252
#define SOF_MEM_FLAG_KERNEL BIT(7)
53-
/** \brief Indicates that if we should return user memory address. */
53+
/** \brief Allocate user memory address. */
5454
#define SOF_MEM_FLAG_USER BIT(8)
55-
/** \brief Indicates that if we should return shared user memory address. */
55+
/** \brief Allocate shared user memory address. */
5656
#define SOF_MEM_FLAG_USER_SHARED_BUFFER BIT(9)
5757
/** \brief Use allocation method for large buffers. */
5858
#define SOF_MEM_FLAG_LARGE_BUFFER BIT(10)

zephyr/include/rtos/alloc.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@
2525
* the first two positions are reserved for SOF_BUF_ flags
2626
*/
2727

28-
/** \name Heap zone flags
28+
/** \name Allocation flags
2929
* @{
3030
*/
3131

32-
/** \brief Indicates we should return DMA-able memory. */
32+
/** \brief Allocate DMA-able memory. */
3333
#define SOF_MEM_FLAG_DMA BIT(2)
34-
/** \brief Indicates that original content should not be copied by realloc. */
34+
/** \brief realloc() skips copying the original content. */
3535
#define SOF_MEM_FLAG_NO_COPY BIT(3)
36-
/** \brief Indicates that if we should return uncached address. */
36+
/** \brief Allocate uncached address. */
3737
#define SOF_MEM_FLAG_COHERENT BIT(4)
38-
/** \brief Indicates that if we should return L3 address. */
38+
/** \brief Allocate L3 address. */
3939
#define SOF_MEM_FLAG_L3 BIT(5)
40-
/** \brief Indicates that if we should return Low power memory address. */
40+
/** \brief Allocate Low power memory address. */
4141
#define SOF_MEM_FLAG_LOW_POWER BIT(6)
42-
/** \brief Indicates that if we should return kernel memory address. */
42+
/** \brief Allocate kernel memory address. */
4343
#define SOF_MEM_FLAG_KERNEL BIT(7)
44-
/** \brief Indicates that if we should return user memory address. */
44+
/** \brief Allocate user memory address. */
4545
#define SOF_MEM_FLAG_USER BIT(8)
46-
/** \brief Indicates that if we should return shared user memory address. */
46+
/** \brief Allocate shared user memory address. */
4747
#define SOF_MEM_FLAG_USER_SHARED_BUFFER BIT(9)
4848
/** \brief Use allocation method for large buffers. */
4949
#define SOF_MEM_FLAG_LARGE_BUFFER BIT(10)

zephyr/lib/alloc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ EXPORT_SYMBOL(rzalloc);
548548
* @param align Alignment in bytes.
549549
* @return Pointer to the allocated memory or NULL if failed.
550550
*/
551-
void *rballoc_align(uint32_t flags, size_t bytes,
552-
uint32_t align)
551+
void *rballoc_align(uint32_t flags, size_t bytes, uint32_t align)
553552
{
554553
struct k_heap *heap;
555554

@@ -568,9 +567,9 @@ void *rballoc_align(uint32_t flags, size_t bytes,
568567
#endif /* CONFIG_USERSPACE */
569568
} else {
570569
#if CONFIG_VIRTUAL_HEAP
571-
/* Use virtual heap if it is available */
572-
if (virtual_buffers_heap)
573-
return virtual_heap_alloc(virtual_buffers_heap, flags, bytes, align);
570+
/* Use virtual heap if it is available */
571+
if (virtual_buffers_heap)
572+
return virtual_heap_alloc(virtual_buffers_heap, flags, bytes, align);
574573
#endif /* CONFIG_VIRTUAL_HEAP */
575574

576575
heap = &sof_heap;

0 commit comments

Comments
 (0)