linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: alex.gaynor@gmail.com, ojeda@kernel.org, aliceryhl@google.com,
	anna-maria@linutronix.de, bjorn3_gh@protonmail.com,
	boqun.feng@gmail.com, dakr@kernel.org, frederic@kernel.org,
	gary@garyguo.net, jstultz@google.com,
	linux-kernel@vger.kernel.org, lossin@kernel.org,
	lyude@redhat.com, rust-for-linux@vger.kernel.org,
	sboyd@kernel.org, tglx@linutronix.de, tmgross@umich.edu,
	acourbot@nvidia.com, daniel.almeida@collabora.com
Subject: Re: [PATCH v1 1/2] rust: add udelay() function
Date: Wed, 27 Aug 2025 09:12:14 +0200	[thread overview]
Message-ID: <87349dw84x.fsf@t14s.mail-host-address-is-not-set> (raw)
In-Reply-To: <CANiq72n4GKUo3LjNkvBvh0C=20tfz7D_jirZpu+2BogqNuK3KQ@mail.gmail.com>

"Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com> writes:

> On Tue, Aug 26, 2025 at 1:59 PM FUJITA Tomonori
> <fujita.tomonori@gmail.com> wrote:
>>
>> This can lead to an unexpected delay duration, but it's safe in Rust’s
>> sense of safety?
>
> If it is just unexpected behavior, then yeah.
>
> Perhaps Andreas is referring to C overflow UB? If that is the case,
> then in the kernel it is actually defined due to
> `-fno-strict-overflow`.

OK, cool Then I would suggest that we just add a small note in the docs
about the C behavior that even though passing an invalid value is
considered a bug, it will not cause UB or memory unsafety.


Best regards,
Andreas Hindborg




  reply	other threads:[~2025-08-27  7:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21  3:57 [PATCH v1 0/2] Add read_poll_timeout_atomic support FUJITA Tomonori
2025-08-21  3:57 ` [PATCH v1 1/2] rust: add udelay() function FUJITA Tomonori
2025-08-26  9:09   ` Andreas Hindborg
2025-08-26 11:59     ` FUJITA Tomonori
2025-08-26 18:03       ` Miguel Ojeda
2025-08-27  7:12         ` Andreas Hindborg [this message]
2025-08-26 12:44   ` Daniel Almeida
2025-08-27  2:43     ` FUJITA Tomonori
2025-08-21  3:57 ` [PATCH v1 2/2] rust: Add read_poll_timeout_atomic function FUJITA Tomonori
2025-08-26 14:02   ` Daniel Almeida
2025-08-27  0:35     ` FUJITA Tomonori
2025-08-27  4:32       ` FUJITA Tomonori
2025-08-26 14:12   ` Danilo Krummrich
2025-08-26 16:59     ` Daniel Almeida
2025-08-26 17:15       ` Danilo Krummrich
2025-08-27  0:14     ` FUJITA Tomonori
2025-08-27  9:00       ` Danilo Krummrich
2025-08-27 10:29         ` Danilo Krummrich
2025-08-27 12:14           ` Daniel Almeida
2025-08-27 12:19             ` Danilo Krummrich
2025-08-27 12:22               ` Daniel Almeida
2025-08-27 12:36                 ` 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=87349dw84x.fsf@t14s.mail-host-address-is-not-set \
    --to=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=anna-maria@linutronix.de \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=frederic@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).