Re: [PATCH v2 2/3] rust: reboot: add emergency_restart() wrapper

[email protected] Thu, 23 Jul 2026 16:19:20 +0000
Newsgroups org.kernel.vger.linux-watchdog
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(=
s) to consider:
- [Low] Missing `#[inline]` annotation on the `emergency_restart` abstracti=
on function.
--

--- Patch [2]: [PATCH v2 2/3] rust: reboot: add emergency_restart() wrapper=
 ---
commit 13ef5d00452d4b8320913eb2ed361d92083a6263
Author: Artem Lytkin <[email protected]>

rust: reboot: add emergency_restart() wrapper

This commit adds a minimal reboot module wrapping the emergency_restart
function. This allows Rust watchdog drivers to restart the machine
immediately without syncing or unmounting filesystems.

> diff --git a/rust/kernel/reboot.rs b/rust/kernel/reboot.rs
> new file mode 100644
> index 0000000000000..f98a85d19f85d
> --- /dev/null
> +++ b/rust/kernel/reboot.rs
[ ... ]
> +/// This is intended for situations where the system is in a state where=
 an
> +/// orderly shutdown is no longer possible, for example when a watchdog
> +/// expires. It can be called from any context, including interrupt cont=
ext.
> +pub fn emergency_restart() {

[Severity: Low]
This isn't a bug, but since this function is small and forwards directly to=
 a
C binding, should it be annotated with #[inline] to match the Rust subsystem
guidelines for abstractions?

> +    // SAFETY: `emergency_restart` has no preconditions and is documente=
d as
> +    // safe to call from any context.
> +    unsafe { bindings::emergency_restart() }
> +}

--=20
Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260723161529.2375=
[email protected]?part=3D2