All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Bernhard Kauer <bk@alpico.io>
Cc: Greg KH <gregkh@linuxfoundation.org>, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust: introduce KVec::pop()
Date: Mon, 2 Dec 2024 11:22:09 +0100	[thread overview]
Message-ID: <Z02KUVQ4GEKPKa_H@pollux> (raw)
In-Reply-To: <Z02D7Gg_cuMKPgxQ@mias.mediconcil.de>

On Mon, Dec 02, 2024 at 10:54:52AM +0100, Bernhard Kauer wrote:
> On Mon, Dec 02, 2024 at 10:06:58AM +0100, Greg KH wrote:
> > On Mon, Dec 02, 2024 at 09:57:58AM +0100, Bernhard Kauer wrote:
> > > Provides a simple stack together with push().
> > 
> > Why?
> 
> Sorry, I forgot the reasoning. 
> 
> Updating to v6.13 broke my external Rust module due to the switch from
> alloc::vec::Vec to kernel::alloc::Vec.  A trivial /s/Vec/KVec/ fixed most
> cases.  However, there is no pop() or any other safe way to remove entries
> from the vector.
> 
> So it looks like I either have to stick to unsafe code or add the
> functionality inside the kernel.
> 
> 
> > >  rust/kernel/alloc/kvec.rs | 28 ++++++++++++++++++++++++++++
> > >  1 file changed, 28 insertions(+)
> > 
> > What in-kernel code needs this?  Shouldn't you also submit this when
> > that happens?
> 
> Fair point.  Unfortunatelly my code is far from ready for inclusion.
> Would a samples/rust/some_example.rs be sufficient?

I don't think this is needed. You're providing an example that can be executed
as KUnit test already with your patch.

This is a pretty basic function and surely gonna be needed for other drivers in
the future as well.

IMHO, *for this* it's enough if you have something that aims for inclusion
upstream, as long as you reference it properly in the commit message.

- Danilo

> 
> 
> Thanks,
> 
> 	Bernhard
> 

  reply	other threads:[~2024-12-02 10:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02  8:57 [PATCH] rust: introduce KVec::pop() Bernhard Kauer
2024-12-02  9:06 ` Greg KH
2024-12-02  9:54   ` Bernhard Kauer
2024-12-02 10:22     ` Danilo Krummrich [this message]
2024-12-02 18:30       ` Miguel Ojeda
2024-12-02  9:54 ` Danilo Krummrich
2024-12-02 18:28 ` Miguel Ojeda
2024-12-03  2:55 ` kernel test robot

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=Z02KUVQ4GEKPKa_H@pollux \
    --to=dakr@kernel.org \
    --cc=bk@alpico.io \
    --cc=gregkh@linuxfoundation.org \
    --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 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.