public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Eliot Courtney" <ecourtney@nvidia.com>,
	"Shashank Sharma" <shashanks@nvidia.com>,
	"Zhi Wang" <zhiw@nvidia.com>, "David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"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>,
	rust-for-linux@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] rust: ptr: add Alignment::from_u64() for DeviceSize constants
Date: Wed, 11 Mar 2026 23:23:24 -0700	[thread overview]
Message-ID: <5afa30fd-d1bb-4cc4-a014-e5b63b7947f5@nvidia.com> (raw)
In-Reply-To: <CANiq72=KjVoPJii7_i-vfe5AL4e5-Lb-qd99j2JR5ZjK1a69Ew@mail.gmail.com>

On 3/11/26 11:16 PM, Miguel Ojeda wrote:
> On Thu, Mar 12, 2026 at 4:15 AM John Hubbard <jhubbard@nvidia.com> wrote:
>>
>> +    /// A build error is triggered if `align` is not a power of two, or if it
>> +    /// exceeds [`usize::MAX`].
> 
> I think this wording comes from the `new` constructor, but there we

Yes it does--guilty as charged, haha. :)

> use a const assert, not a runtime one.
> 
> So as you mention in the commit message,  it is true that if you call
> it in a const context you will get it at compile-time error, but the
> wording here in the docs seems to imply otherwise.
> 

Good catch, thanks.


thanks,
-- 
John Hubbard


  reply	other threads:[~2026-03-12  6:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12  3:15 [PATCH v2 0/3] rust, nova-core: add DeviceSize trait for SZ_* constants John Hubbard
2026-03-12  3:15 ` [PATCH v2 1/3] rust: sizes: add DeviceSize trait for device address space constants John Hubbard
2026-03-24 14:32   ` Alexandre Courbot
2026-03-12  3:15 ` [PATCH v2 2/3] rust: ptr: add Alignment::from_u64() for DeviceSize constants John Hubbard
2026-03-12  6:16   ` Miguel Ojeda
2026-03-12  6:23     ` John Hubbard [this message]
2026-03-24 14:19   ` Gary Guo
2026-03-12  3:15 ` [PATCH v2 3/3] gpu: nova-core: use DeviceSize trait for u64 size constants John Hubbard
2026-03-24 14:06   ` Alexandre Courbot

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=5afa30fd-d1bb-4cc4-a014-e5b63b7947f5@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=gary@garyguo.net \
    --cc=joelagnelf@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=shashanks@nvidia.com \
    --cc=simona@ffwll.ch \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=zhiw@nvidia.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