Skip to content

Commit

Permalink
alloc: Simplify function return logic
Browse files Browse the repository at this point in the history
Simplify function returns by merging assignment and return into
one command line.

Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
  • Loading branch information
simransinghal authored and lgirdwood committed Mar 31, 2020
1 parent 79b39cc commit 1e39cee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,7 @@ static void *align_ptr(struct mm_heap *heap, uint32_t alignment,
mod_align = alignment - ((uintptr_t)ptr % alignment);

/* Calculate aligned pointer */
ptr = (char *)ptr + mod_align;

return ptr;
return (char *)ptr + mod_align;
}

/* allocate single block */
Expand Down

0 comments on commit 1e39cee

Please sign in to comment.