From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Brendan Shephard <bshephar@bne-home.net>
Cc: aliceryhl@google.com, lorenzo.stoakes@oracle.com,
Liam.Howlett@oracle.com, ojeda@kernel.org, boqun.feng@gmail.com,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu, dakr@kernel.org,
linux-mm@kvack.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: Test page_align usize::MAX boundary edges
Date: Tue, 30 Dec 2025 11:14:37 +0100 [thread overview]
Message-ID: <CANiq72mdkb6A82oy0DoUWn=jv75-R7EHTNvJRW7o=JeNa3eeHg@mail.gmail.com> (raw)
In-Reply-To: <aVOhfWmyJBxD4SUa@fedora-g16.bne-home.net>
On Tue, Dec 30, 2025 at 10:55 AM Brendan Shephard <bshephar@bne-home.net> wrote:
>
> @miguel, Thanks for the pointers in:
> https://lore.kernel.org/all/CANiq72kcMLXz=xyZeKC0=j_e0BzJEY3wGpBTTxfJsc6EZhCnXA@mail.gmail.com/
> https://lore.kernel.org/rust-for-linux/CANiq72mLPvB_6Ow3bW5-V4-km=RyA59chQ1g1x9qUt2P-zZweg@mail.gmail.com/
>
> Let me know if this addresses the points you were raising in those.
> Maybe you just wanted usize::MAX and then one over? The first test
> case might be unnecessary. The last two do a fine job of illustrating the
> point I think.
Thanks! Yeah, either way looks good to me. Personally, I tend to like
tests that check both edges.
By the way, the original comment mentioned "overflow" explicitly,
which was good since it conceptually links to the main docs which also
mention it. It also seemed more aligned with the other two comments.
Perhaps you changed it since now one of them doesn't return `None`? In
that case, I would just remove that bit e.g.
// Requested address causes overflow.
i.e. I think it is clear that the first case is not the overflow one.
But it is not a big deal either way.
By the way, in commit messages, we normally don't use paragraphs like:
This patch is a follow-up of: "[PATCH v8] rust: Return Option from
page_align and ensure no usize overflow"
Instead, it is better to provide a lore.kernel.org permalink to the
patch or, if the patch was already applied, refer directly to the
commit with the hash and title. However, in cases like this where it
is not really important for the change itself, I would just move that
line below the `---` line so that it is not part of the commit
message.
I hope that helps!
Cheers,
Miguel
next prev parent reply other threads:[~2025-12-30 10:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 9:48 bshephar
2025-12-30 9:55 ` Brendan Shephard
2025-12-30 10:14 ` Miguel Ojeda [this message]
2025-12-30 11:40 ` Brendan Shephard
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='CANiq72mdkb6A82oy0DoUWn=jv75-R7EHTNvJRW7o=JeNa3eeHg@mail.gmail.com' \
--to=miguel.ojeda.sandonis@gmail.com \
--cc=Liam.Howlett@oracle.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=bshephar@bne-home.net \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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