mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
lib: sbi_scratch: Optimize the alignment code for alloc size
Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
c6a092cd80
commit
ed88a63b90
1 changed files with 2 additions and 2 deletions
|
@ -59,8 +59,8 @@ unsigned long sbi_scratch_alloc_offset(unsigned long size)
|
|||
if (!size)
|
||||
return 0;
|
||||
|
||||
if (size & (__SIZEOF_POINTER__ - 1))
|
||||
size = (size & ~(__SIZEOF_POINTER__ - 1)) + __SIZEOF_POINTER__;
|
||||
size += __SIZEOF_POINTER__ - 1;
|
||||
size &= ~((unsigned long)__SIZEOF_POINTER__ - 1);
|
||||
|
||||
spin_lock(&extra_lock);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue