Skip to content

Commit 5d80cf7

Browse files
wangchdoacassis
authored andcommitted
arch/tricore: remove magic number in tricore_checkstack.c
before: | start = (alloc + 3) & ~3; | end = (alloc + size) & ~3; after: | start = STACK_ALIGN_UP((uintptr_t)alloc); | end = STACK_ALIGN_DOWN((uintptr_t)alloc + size); Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
1 parent 12486d2 commit 5d80cf7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/tricore/src/common/tricore_checkstack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ size_t tricore_stack_check(uintptr_t alloc, size_t size)
7979

8080
/* Get aligned addresses of the top and bottom of the stack */
8181

82-
start = (alloc + 3) & ~3;
83-
end = (alloc + size) & ~3;
82+
start = STACK_ALIGN_UP((uintptr_t)alloc);
83+
end = STACK_ALIGN_DOWN((uintptr_t)alloc + size);
8484

8585
/* Get the adjusted size based on the top and bottom of the stack */
8686

0 commit comments

Comments
 (0)