From: Boqun Feng <boqun.feng@gmail.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
ojeda@kernel.org, alex.gaynor@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, benno.lossin@proton.me,
a.hindborg@samsung.com, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, mingo@redhat.com, peterz@infradead.org,
juri.lelli@redhat.com, vincent.guittot@linaro.org,
dietmar.eggemann@arm.com, rostedt@goodmis.org,
bsegall@google.com, mgorman@suse.de, vschneid@redhat.com,
pmladek@suse.com, fujita.tomonori@gmail.com, mingo@kernel.org,
tamird@gmail.com
Subject: Re: [PATCH v4 1/2] rust: Introduce file_from_location()
Date: Thu, 19 Jun 2025 13:51:00 -0700 [thread overview]
Message-ID: <aFR4NHiCvvFxvP1D@tardis.local> (raw)
In-Reply-To: <CANiq72n7d89aHiM2fcHnEUE+9=0zyEAFmBoURi4O02w-isSiKw@mail.gmail.com>
On Thu, Jun 19, 2025 at 10:42:44PM +0200, Miguel Ojeda wrote:
> On Thu, Jun 19, 2025 at 5:10 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> >
> > +/// // - A path like "rust/kernel/example.rs" if file_with_nul() available.
>
> "is available."
>
Fixed.
> > +pub fn file_from_location<'a>(_loc: &'a core::panic::Location<'a>) -> &'a core::ffi::CStr {
> > + #[cfg(CONFIG_RUSTC_HAS_FILE_WITH_NUL)]
> > + { _loc.file_with_nul() }
> > +
> > + #[cfg(not(CONFIG_RUSTC_HAS_FILE_WITH_NUL))]
> > + { c"<Location::file_with_nul() not supported>" }
> > +}
>
> If a `let _` works, then it may be better -- please see a similar case at:
>
> https://lore.kernel.org/rust-for-linux/CANiq72=ph_XG0TtkdsNJCUZMiAMYBo11eJaCTLCTpTAFXtcNMA@mail.gmail.com/
>
Make sense, applied.
> The new version looks great, thanks!
>
Thanks! I pushed the updated version at:
https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/log/?h=rust-sched-v2
"-v2" because it's going to be a v2 of the pull request.
Regards,
Boqun
> Cheers,
> Miguel
next prev parent reply other threads:[~2025-06-19 20:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 15:10 [PATCH v4 0/2] Add Rust version of might_sleep() Boqun Feng
2025-06-19 15:10 ` [PATCH v4 1/2] rust: Introduce file_from_location() Boqun Feng
2025-06-19 20:42 ` Miguel Ojeda
2025-06-19 20:51 ` Boqun Feng [this message]
2025-07-03 8:36 ` [tip: sched/core] " tip-bot2 for Boqun Feng
2025-06-19 15:10 ` [PATCH v4 2/2] rust: task: Add Rust version of might_sleep() Boqun Feng
2025-07-03 8:36 ` [tip: sched/core] " tip-bot2 for FUJITA Tomonori
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=aFR4NHiCvvFxvP1D@tardis.local \
--to=boqun.feng@gmail.com \
--cc=a.hindborg@samsung.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=bsegall@google.com \
--cc=dakr@kernel.org \
--cc=dietmar.eggemann@arm.com \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@gmail.com \
--cc=tmgross@umich.edu \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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
all inboxes | Powered by JetHome®