Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] The `rcu_barrier()` abstraction function is missing the mandatory 
`#[inline]` attribute.
--

commit 9b4d6fad89b434f3d9d6204b87f3b0eed4df4bb6
Author: Philipp Stanner <[email protected]>

rust: sync: Add abstraction for rcu_barrier()

This commit adds a safe Rust abstraction for the C function rcu_barrier(),
wrapping the underlying C binding so it can be called safely from Rust.

> diff --git a/rust/kernel/sync/rcu.rs b/rust/kernel/sync/rcu.rs
> index a32bef6e490b0..9196feb62d6de 100644
> --- a/rust/kernel/sync/rcu.rs
> +++ b/rust/kernel/sync/rcu.rs
> @@ -50,3 +50,9 @@ fn drop(&mut self) {
>  pub fn read_lock() -> Guard {
>      Guard::new()
>  }
> +
> +/// Wait for all pending [`bindings::call_rcu()`] callbacks, if there are 
> any.
> +pub fn rcu_barrier() {

[Severity: Low]
This isn't a bug, but according to the Rust subsystem guidelines, functions
in abstractions that are small or simply forward to a C binding call should
be annotated with #[inline].

Could we add the #[inline] attribute to rcu_barrier() since it just forwards
to the C binding?

> +    // SAFETY: `rcu_barrier()` is always safe to be called. It just might 
> wait for a grace period.
> +    unsafe { bindings::rcu_barrier() };
> +}

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to