rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Abdiel Janulgue <abdiel.janulgue@gmail.com>
To: Alice Ryhl <aliceryhl@google.com>
Cc: rust-for-linux@vger.kernel.org, daniel.almeida@collabora.com,
	a.hindborg@kernel.org, linux-kernel@vger.kernel.org,
	dakr@redhat.com, airlied@redhat.com,
	miguel.ojeda.sandonis@gmail.com, wedsonaf@gmail.com,
	Andreas Hindborg <a.hindborg@samsung.com>
Subject: Re: [PATCH v3 2/2] rust: add dma coherent allocator abstraction.
Date: Mon, 4 Nov 2024 11:36:26 +0200	[thread overview]
Message-ID: <f6889ce1-f1e0-438d-a9e6-4340a92cb6ef@gmail.com> (raw)
In-Reply-To: <CAH5fLgisLyW-d9rsHJ8Vp8HpWh7PZxtkXooVQyMTxs445Ah4GQ@mail.gmail.com>



On 04/11/2024 11:31, Alice Ryhl wrote:
> On Mon, Nov 4, 2024 at 10:07 AM Abdiel Janulgue
> <abdiel.janulgue@gmail.com> wrote:
>> +/// Abstraction of dma_alloc_coherent
>> +///
>> +/// # Invariants
>> +///
>> +/// For the lifetime of an instance of CoherentAllocation, the cpu address is a valid pointer
>> +/// to an allocated region of consistent memory and we hold a reference to the device.
>> +pub struct CoherentAllocation<T: Add> {
> 
> Requiring `T: Add` is very unusual. Why?
> 
> I don't even see any additions anywhere.
> 
> Alice

Background here:
https://lore.kernel.org/all/ee45ae5f-133d-4d38-bb4a-d3515790feb4@gmail.com/

Basically this aims to restrict the abstraction to non-ZST types. Are 
there better (clever) ways to do this?

Thanks!

/Abdiel


  reply	other threads:[~2024-11-04  9:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04  9:06 [PATCH v3 0/2] Add dma coherent allocator abstraction Abdiel Janulgue
2024-11-04  9:06 ` [PATCH v3 1/2] rust: error: Add EOVERFLOW Abdiel Janulgue
2024-11-04  9:06 ` [PATCH v3 2/2] rust: add dma coherent allocator abstraction Abdiel Janulgue
2024-11-04  9:31   ` Alice Ryhl
2024-11-04  9:36     ` Abdiel Janulgue [this message]
2024-11-04 10:00       ` Alice Ryhl
2024-11-04 10:31         ` Abdiel Janulgue

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=f6889ce1-f1e0-438d-a9e6-4340a92cb6ef@gmail.com \
    --to=abdiel.janulgue@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=a.hindborg@samsung.com \
    --cc=airlied@redhat.com \
    --cc=aliceryhl@google.com \
    --cc=dakr@redhat.com \
    --cc=daniel.almeida@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /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).