[PATCH v2 03/11] arm64: debug: call step handlers statically

Ada Couprie Diaz ada.coupriediaz at arm.com
Wed May 28 09:02:34 PDT 2025


On 20/05/2025 16:35, Will Deacon wrote:

> On Mon, May 12, 2025 at 06:43:18PM +0100, Ada Couprie Diaz wrote:
>> +#if CONFIG_UPROBES
> nit: this should be #ifdef and my compiler complains about that:
>
>    | arch/arm64/kernel/debug-monitors.c:172:5: warning: 'CONFIG_UPROBES' is not defined, evaluates to 0 [-Wundef]
Indeed, that's my bad.
Replacing it in v3 with an #ifndef for the stand-in.
>> +		return uprobe_singlestep_handler(regs, esr);
>> +#else
>> +		return DBG_HOOK_ERROR;
>> +#endif
> It would probably be cleaner to have a static inline definition of
> uprobe_singlestep_handler() when !CONFIG_UPROBES that just returns
> DBG_HOOK_ERROR.
>
>>   	}
>>   
>> -	return retval;
>> +#ifdef CONFIG_KGDB
>> +	return kgdb_singlestep_handler(regs, esr);
>> +#else
>> +	return DBG_HOOK_ERROR;
>> +#endif
> Similarly here.

That's fair, it does make the function itself very clear !

Replaced the #ifdefs in the function with static inline stand-ins
when the configs are disabled for v3.

> Will

Thanks,

Ada




More information about the linux-arm-kernel mailing list