On 29.11.2023 18:50, Julien Grall wrote: > On 24/11/2023 17:29, Simone Ballarin wrote: >> --- a/xen/arch/arm/include/asm/regs.h >> +++ b/xen/arch/arm/include/asm/regs.h >> @@ -48,7 +48,7 @@ static inline bool regs_mode_is_32bit(const struct >> cpu_user_regs *regs) >> >> static inline bool guest_mode(const struct cpu_user_regs *r) >> { >> - unsigned long diff = (char *)guest_cpu_user_regs() - (char *)(r); >> + unsigned long diff = (char *)guest_cpu_user_regs() - (const char *)(r); > > NIT: I would take the opportunity to use 'const char*' for the first one > as well.
Considering a similar change likely is being (or is to be) done on x86, I'd favor not abusing "char *" here. Either use "void *", or - considering the intended result type - go straight to "unsigned long" (or uintptr_t). I would certainly ask for that on the x86 side. Jan