Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] rust: missing #[inline] on Deref::deref in abstraction
--

commit f7dee333951179025d9c4ebf4f5a3d49e66c7f5e
Author: Philipp Stanner <[email protected]>

rust: DmaFence: Implement Deref for FenceContext

This commit implements the Deref trait for FenceContext. This allows users
to easily access the data carried by the context.

> diff --git a/rust/kernel/dma_buf/dma_fence.rs 
> b/rust/kernel/dma_buf/dma_fence.rs
> index eef2b9e93f356..0028124e6aa64 100644
> --- a/rust/kernel/dma_buf/dma_fence.rs
> +++ b/rust/kernel/dma_buf/dma_fence.rs
[ ... ]
> @@ -86,6 +86,14 @@ pub struct FenceContext<T: FenceContextOps + Send + Sync> {
>      data: T,
>  }
>  
> +impl<T: Send + Sync + FenceContextOps> Deref for FenceContext<T> {
> +    type Target = T;
> +
> +    fn deref(&self) -> &Self::Target {

[Severity: Low]
This isn't a bug, but should this method be marked with the #[inline]
attribute?

The Rust subsystem guidelines recommend that small functions within
abstractions (such as the kernel crate) be annotated with #[inline]. Since
this deref implementation is a trivial getter returning a reference to a
struct field, omitting the attribute might lead to unnecessary function call
overhead when used frequently.

> +        &self.data
> +    }
> +}

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

Reply via email to