Skip to content

Commit dde9462

Browse files
peter-mitsiskartben
authored andcommitted
arch: tweak xtensa_mem_kernel_has_access() API
Adds 'const' to address pointer as its memory contents do not change. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
1 parent 84d2f7f commit dde9462

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/xtensa/core/mpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ int arch_buffer_validate(const void *addr, size_t size, int write)
10781078
return ret;
10791079
}
10801080

1081-
bool xtensa_mem_kernel_has_access(void *addr, size_t size, int write)
1081+
bool xtensa_mem_kernel_has_access(const void *addr, size_t size, int write)
10821082
{
10831083
uintptr_t aligned_addr;
10841084
size_t aligned_size, addr_offset;

arch/xtensa/core/ptables.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static int mem_buffer_validate(const void *addr, size_t size, int write, int rin
11121112
return ret;
11131113
}
11141114

1115-
bool xtensa_mem_kernel_has_access(void *addr, size_t size, int write)
1115+
bool xtensa_mem_kernel_has_access(const void *addr, size_t size, int write)
11161116
{
11171117
return mem_buffer_validate(addr, size, write, XTENSA_MMU_KERNEL_RING) == 0;
11181118
}

arch/xtensa/core/syscall_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ size_t arch_user_string_nlen(const char *s, size_t maxsize, int *err_arg)
115115
* For MPU systems, this would simply results in access errors
116116
* and the exception handler will terminate the thread.
117117
*/
118-
if (!xtensa_mem_kernel_has_access((void *)s, maxsize, 0)) {
118+
if (!xtensa_mem_kernel_has_access(s, maxsize, 0)) {
119119
/*
120120
* API says we need to set err_arg to -1 if there are
121121
* any errors.

arch/xtensa/include/xtensa_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void xtensa_userspace_enter(k_thread_entry_t user_entry,
7272
*
7373
* @return False if the permissions don't match.
7474
*/
75-
bool xtensa_mem_kernel_has_access(void *addr, size_t size, int write);
75+
bool xtensa_mem_kernel_has_access(const void *addr, size_t size, int write);
7676

7777
/**
7878
* @}

0 commit comments

Comments
 (0)