rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: ManeraKai <manerakai@protonmail.com>
Cc: "aliceryhl@google.com" <aliceryhl@google.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] rust: miscdevice: Implemented `read` and `write`
Date: Thu, 18 Sep 2025 17:06:37 +0200	[thread overview]
Message-ID: <2025091841-remindful-manned-a57f@gregkh> (raw)
In-Reply-To: <2025091820-canine-tanning-3def@gregkh>

On Thu, Sep 18, 2025 at 04:59:01PM +0200, gregkh@linuxfoundation.org wrote:
> On Thu, Sep 18, 2025 at 02:45:36PM +0000, ManeraKai wrote:
> > Added the general declaration in `FileOperations`. And implemented the
> > safe wrapping for misc.
> 
> While read/write is "traditional", perhaps instead you should just
> export read_iter and write_iter as that is the proper way forward for
> drivers to be using.

Wait, maybe not.  The _iter stuff is "hard" for misc devices, and I
don't think that any of the current ones use that, so nevermind, a
simple read/write should be all that we need here.

What type of real misc driver do you want to write in rust that you need
a read/write callback and not just an ioctl one?

thanks,

greg k-h

  reply	other threads:[~2025-09-18 15:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 14:44 [PATCH 0/3] rust: miscdevice: Extending the abstraction ManeraKai
2025-09-18 14:45 ` [PATCH 1/3] rust: miscdevice: Moved `MiscDevice` to a more general abstraction ManeraKai
2025-09-18 15:00   ` gregkh
2025-09-18 14:45 ` [PATCH 2/3] rust: miscdevice: Implemented `read` and `write` ManeraKai
2025-09-18 14:59   ` gregkh
2025-09-18 15:06     ` gregkh [this message]
2025-09-18 15:57       ` ManeraKai
2025-09-18 15:15   ` Alice Ryhl
2025-09-18 17:22     ` ManeraKai
2025-09-18 17:24       ` Alice Ryhl
2025-09-18 14:45 ` [PATCH 3/3] samples: rust: Updated the example using the Rust MiscDevice abstraction ManeraKai
2025-09-18 15:01   ` gregkh

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=2025091841-remindful-manned-a57f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=aliceryhl@google.com \
    --cc=arnd@arndb.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manerakai@protonmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).