On 08.11.2023 16:42, Federico Serafini wrote:
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1236,7 +1236,8 @@ int do_bug_frame(const struct cpu_user_regs *regs,
> vaddr_t pc)
>
> if ( id == BUGFRAME_run_fn )
> {
> - void (*fn)(const struct cpu_user_regs *) = (void *)regs->BUG_FN_REG;
> + typedef void (*bug_fn_t)(const struct cpu_user_regs *regs);
Just to mention it: Type and name don't match here. You define a pointer-
to-function type, yet you name it as if it was a function type. Perhaps
the latter is really meant, such that ...
> + bug_fn_t fn = (void *)regs->BUG_FN_REG;
... e.g. here the pointer-ness of the variable can still remain visible:
bug_fn_t *fn = (void *)regs->BUG_FN_REG;
Jan