All of lore.kernel.org
 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] rust: mem: add DropGuard
Date: Wed, 16 Sep 2026 10:15:56 +0000	[thread overview]
Message-ID: <20260916101557.23DC01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916100937.541933-1-mohamed.osama189110@gmail.com>

> Add a `DropGuard` type to the Rust kernel memory module for running
> cleanup code when a scope is left.
> 
> `DropGuard` runs a `FnOnce` callback when dropped and provides
> `dismiss()` to take the wrapped value without running the callback.
> 
> Replace the current `ScopeGuard` users in `gen_disk`, `serdev`, and
> `sync::lock` with `DropGuard`. Keep `ScopeGuard` since it is still used
> elsewhere.
> 
> Add KUnit tests for cleanup on drop and `dismiss()`.
> 
> Tested with:
> - `make LLVM=1 -j$(nproc)`
> - KUnit: 8 tests passed
> - `make LLVM=1 rustfmtcheck`
> - `git diff --check`
> - `checkpatch.pl`
> - `make LLVM=1 rustdoc`
> 
> Suggested-by: Gary Guo <gary@garyguo.net>
> Link: https://github.com/Rust-for-Linux/linux/issues/1255
> Signed-off-by: Mohamed Osama <mohamed.osama189110@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

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


      reply	other threads:[~2026-09-16 10:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 10:09 [PATCH v3] rust: mem: add DropGuard Mohamed Osama
2026-09-16 10:15 ` sashiko-bot [this message]

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=20260916101557.23DC01F000FF@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.