Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mohamed Osama" <mohamed.osama189110@gmail.com>
Cc: gary@garyguo.net, linux-serial@vger.kernel.org, ojeda@kernel.org
Subject: Re: [PATCH v3 2/5] rust: mem: add DropGuard
Date: Sat, 26 Sep 2026 17:42:41 +0000	[thread overview]
Message-ID: <20260926174241.97E7A1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260926173315.56772-3-mohamed.osama189110@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rust: vertical import style violation for core::ops
--

commit 14b3938196a8942ce3b9aa406f0d5ba59f964b6e
Author: Mohamed Osama <mohamed.osama189110@gmail.com>

rust: mem: add DropGuard

This commit adds DropGuard to the Rust kernel memory module to run a cleanup
callback when dropped, mirroring the upstream core::mem::DropGuard API. It
keeps ScopeGuard for existing users but establishes the new kernel API
alongside it.

> diff --git a/rust/kernel/mem.rs b/rust/kernel/mem.rs
> index f2d4cdf87d00b..e7a84d15f3b38 100644
> --- a/rust/kernel/mem.rs
> +++ b/rust/kernel/mem.rs
> @@ -4,6 +4,93 @@
>  
>  use crate::prelude::*;
>  
> +use core::mem::ManuallyDrop;
> +use core::ops::{Deref, DerefMut};

[Severity: Low]
This isn't a bug, but this import statement groups multiple items together,
failing to adhere to the kernel's vertical import style guidelines. Should
Deref and DerefMut be imported on separate lines?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260926173315.56772-1-mohamed.osama189110@gmail.com?part=2

  reply	other threads:[~2026-09-26 17:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 17:33 [PATCH v3 0/5] rust: add DropGuard Mohamed Osama
2026-09-26 17:33 ` [PATCH v3 1/5] rust: add DropGuard KUnit test configuration Mohamed Osama
2026-09-26 17:39   ` sashiko-bot
2026-09-26 17:33 ` [PATCH v3 2/5] rust: mem: add DropGuard Mohamed Osama
2026-09-26 17:42   ` sashiko-bot [this message]
2026-09-26 23:53   ` Gary Guo
2026-09-26 17:33 ` [PATCH v3 3/5] rust: block: gen_disk: use DropGuard Mohamed Osama
2026-09-26 17:39   ` sashiko-bot
2026-09-26 17:33 ` [PATCH v3 4/5] rust: serdev: " Mohamed Osama
2026-09-26 17:42   ` sashiko-bot
2026-09-26 17:33 ` [PATCH v3 5/5] rust: sync: lock: " Mohamed Osama
2026-09-26 17:40   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260926174241.97E7A1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-serial@vger.kernel.org \
    --cc=mohamed.osama189110@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox