mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Timur Tabi <ttabi@nvidia.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"mmaurer@google.com" <mmaurer@google.com>
Cc: "tmgross@umich.edu" <tmgross@umich.edu>,
	"benno.lossin@proton.me" <benno.lossin@proton.me>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"gary@garyguo.net" <gary@garyguo.net>,
	"a.hindborg@kernel.org" <a.hindborg@kernel.org>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"bjorn3_gh@protonmail.com" <bjorn3_gh@protonmail.com>,
	"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
	"dakr@kernel.org" <dakr@kernel.org>,
	"alex.gaynor@gmail.com" <alex.gaynor@gmail.com>,
	"aliceryhl@google.com" <aliceryhl@google.com>,
	"ojeda@kernel.org" <ojeda@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"samitolvanen@google.com" <samitolvanen@google.com>
Subject: Re: [PATCH v2 4/4] rust: samples: Add debugfs sample
Date: Thu, 1 May 2025 16:44:01 +0000	[thread overview]
Message-ID: <487552320d1b854769797cd8c4c5c95cfc1248ff.camel@nvidia.com> (raw)
In-Reply-To: <2025050137-ongoing-such-46f6@gregkh>

On Thu, 2025-05-01 at 09:40 +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 30, 2025 at 11:31:59PM +0000, Matthew Maurer wrote:
> > Provides an example of using the Rust DebugFS bindings.
> > 
> > Signed-off-by: Matthew Maurer <mmaurer@google.com>
> 
> Much nicer, many thanks for this!
> 
> Some minor comments on the sample code here.  As someone coming from C
> with limited Rust experience, I think I do understand it, but I think it
> could use a bunch of comments to make it more "obvious" what is
> happening, see below.

Agree 100%.  I'm using this patch set to learn more about R4L.

> > +static EXAMPLE: AtomicU32 = AtomicU32::new(8);
> 
> Wait, why is this set to 8 and then you automatically set it to 10 after
> you create the file?  No one is ever going to see 8 as a valid value
> unless they really race to read the file, right?

Well, it does show that the driver still has the ability to write to EXAMPLE even after the debugfs
entry is created.  That demonstrates that the driver retains ownership, which is a useful test for
any debugfs implementation.


      reply	other threads:[~2025-05-01 16:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 23:31 [PATCH v2 0/4] rust: DebugFS Bindings Matthew Maurer
2025-04-30 23:31 ` [PATCH v2 1/4] rust: debugfs: Bind DebugFS directory creation Matthew Maurer
2025-05-01 10:00   ` Miguel Ojeda
2025-05-01 10:16   ` Danilo Krummrich
2025-05-01 16:02     ` Matthew Maurer
2025-05-01 16:35       ` Danilo Krummrich
2025-04-30 23:31 ` [PATCH v2 2/4] rust: debugfs: Bind file creation for long-lived Display Matthew Maurer
2025-05-01 10:37   ` Danilo Krummrich
2025-05-01 16:09     ` Matthew Maurer
2025-05-01 17:32       ` Danilo Krummrich
2025-04-30 23:31 ` [PATCH v2 3/4] rust: debugfs: Support format hooks Matthew Maurer
2025-05-01 10:00   ` Miguel Ojeda
2025-04-30 23:31 ` [PATCH v2 4/4] rust: samples: Add debugfs sample Matthew Maurer
2025-05-01  7:40   ` Greg Kroah-Hartman
2025-05-01 16:44     ` Timur Tabi [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=487552320d1b854769797cd8c4c5c95cfc1248ff.camel@nvidia.com \
    --to=ttabi@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmaurer@google.com \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=tmgross@umich.edu \
    /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

all inboxes | Powered by JetHome®