Cast the return value of getauxptr() from void* to uintptr_t (which is defined as __uintcap_t in purecap) to address compiler warnings.
Remove the unnecessary cast on getauxval(), as uintptr_t is defined as unsigned long in non-purecap anyway.
Signed-off-by: Aditya Deshpande aditya.deshpande@arm.com --- Hi all,
This is a minor follow up patch to the vDSO series which fixes a compiler warning about implicit type casts. The current state of the vDSO tests shouldn't cause any issues with the release as: 1. This is just a compiler warning - the test code is still functionally correct. 2. The vDSO selftests are built standalone anyways.
Thanks, Aditya
--- tools/testing/selftests/vDSO/parse_vdso.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/vDSO/parse_vdso.h b/tools/testing/selftests/vDSO/parse_vdso.h index 54ad67f463cc..9c891a12be7d 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.h +++ b/tools/testing/selftests/vDSO/parse_vdso.h @@ -38,9 +38,9 @@ void vdso_init_from_auxv(void *auxv); static inline uintptr_t get_sysinfo_ehdr() { #ifdef __CHERI_PURE_CAPABILITY__ - return getauxptr(AT_SYSINFO_EHDR); + return (uintptr_t)getauxptr(AT_SYSINFO_EHDR); #else - return (uintptr_t)getauxval(AT_SYSINFO_EHDR); + return getauxval(AT_SYSINFO_EHDR); #endif }
On 07/12/2023 18:01, Aditya Deshpande wrote:
Cast the return value of getauxptr() from void* to uintptr_t (which is defined as __uintcap_t in purecap) to address compiler warnings.
Remove the unnecessary cast on getauxval(), as uintptr_t is defined as unsigned long in non-purecap anyway.
Signed-off-by: Aditya Deshpande aditya.deshpande@arm.com
Hi all,
This is a minor follow up patch to the vDSO series which fixes a compiler warning about implicit type casts. The current state of the vDSO tests shouldn't cause any issues with the release as:
- This is just a compiler warning - the test code is still functionally
correct. 2. The vDSO selftests are built standalone anyways.
Thanks, Aditya
tools/testing/selftests/vDSO/parse_vdso.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thank you, applied on next. While at it I've also added the missing "void" argument in the function prototype, as suggested on the corresponding LTP patch [1].
Kevin
[1] https://op-lists.linaro.org/archives/list/linux-morello-ltp@op-lists.linaro....
diff --git a/tools/testing/selftests/vDSO/parse_vdso.h b/tools/testing/selftests/vDSO/parse_vdso.h index 54ad67f463cc..9c891a12be7d 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.h +++ b/tools/testing/selftests/vDSO/parse_vdso.h @@ -38,9 +38,9 @@ void vdso_init_from_auxv(void *auxv); static inline uintptr_t get_sysinfo_ehdr() { #ifdef __CHERI_PURE_CAPABILITY__
- return getauxptr(AT_SYSINFO_EHDR);
- return (uintptr_t)getauxptr(AT_SYSINFO_EHDR);
#else
- return (uintptr_t)getauxval(AT_SYSINFO_EHDR);
- return getauxval(AT_SYSINFO_EHDR);
#endif }
linux-morello@op-lists.linaro.org