Re: [PATCH v3 5/5] rust: device: add dynamic debug support to dev_dbg!
From: Alice Ryhl
Date: Fri Oct 16 2026 - 04:42:30 EST
On Thu, Oct 01, 2026 at 05:59:40PM +0300, Zhi Wang wrote:
> +__rust_helper void rust_helper_ddebug_dev_print(struct _ddebug *descriptor,
> + const struct device *dev,
> + const void *args)
> +{
> + __dynamic_dev_dbg(descriptor, dev, "%pA", args);
> + if (descriptor->flags & _DPRINTK_FLAGS_INCL_STACK)
> + dump_stack();
> +}
Nit (also applies to `rust_helper_ddebug_print` in patch 4/5): if patch 3/5
also exposes `__dynamic_dump_stack` under `#ifdef CONFIG_DYNAMIC_DEBUG_CORE`,
both helpers can use `__dynamic_dump_stack((*descriptor))` instead of
open-coding the `_DPRINTK_FLAGS_INCL_STACK` check.
> + pub unsafe fn dev_print<Ctx: DeviceContext>(
> + descriptor: *mut Self,
> + dev: &Device<Ctx>,
> + args: fmt::Arguments<'_>,
> + ) {
Please add `#[inline]` here too.
Alice