rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "ai qubits" <aiqubits@hotmail.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Sophon Zhang via B4 Relay"
	<devnull+aiqubits.hotmail.com@kernel.org>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Onur Özkan" <work@onurozkan.dev>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 回复: [PATCH v4] rust: pci: reject IRQ vector indices that do not fit in u32
Date: Tue, 01 Sep 2026 13:06:54 +0100	[thread overview]
Message-ID: <DL3YTUU7W86I.29BD41EC3XI9V@garyguo.net> (raw)
In-Reply-To: <SN7PR07MB9708B6C36F40362265511D2ECFA82@SN7PR07MB9708.namprd07.prod.outlook.com>

On Tue Sep 1, 2026 at 12:47 PM BST, ai qubits wrote:
> Thanks for the question, Alexandre, and for the clarification, Danilo.
> 
> I agree that usize is the more appropriate type for an index-oriented
> Rust API. Callers are likely to obtain indices from ranges, iterators, or
> other Rust indexing operations, which naturally use usize.
> 
> The unsigned int expected by pci_irq_vector() is an implementation detail
> of the C interface, so the necessary validation and conversion should
> remain inside the Rust abstraction rather than being exposed to callers.
> 
> I will therefore keep IrqVectorRegistration::index() accepting usize and
> handle the C API boundary internally.
> 
> Best regards,
> Sophon

Hi Sophon,

Please avoid top-posting. See
https://subspace.kernel.org/etiquette.html#do-not-top-post-when-replying (and
rest of that page, too).

Also, your email contains byte order marks (FEFF). Not sure what clients are you
using, but please pick a proper one for plain text mails.

Thanks,
Gary


  reply	other threads:[~2026-09-01 12:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 17:09 [PATCH v4] rust: pci: reject IRQ vector indices that do not fit in u32 Sophon Zhang via B4 Relay
2026-09-01 10:58 ` Alexandre Courbot
2026-09-01 11:08   ` Danilo Krummrich
2026-09-01 13:32     ` Alexandre Courbot
2026-09-01 13:36       ` Danilo Krummrich
2026-09-01 13:52         ` Alexandre Courbot
2026-09-01 13:48       ` Gary Guo
2026-09-01 14:08         ` Alexandre Courbot
2026-09-01 15:58           ` 回复: " ai qubits
2026-09-01 11:47   ` ai qubits
2026-09-01 12:06     ` Gary Guo [this message]
2026-09-01 12:35       ` 回复: " ai qubits
2026-09-01 12:42   ` Miguel Ojeda
2026-09-01 16:19 ` Gary Guo
2026-09-01 16:31 ` Danilo Krummrich

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=DL3YTUU7W86I.29BD41EC3XI9V@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aiqubits@hotmail.com \
    --cc=aliceryhl@google.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=devnull+aiqubits.hotmail.com@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.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 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).