[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFR4NHiCvvFxvP1D@tardis.local>
Date: Thu, 19 Jun 2025 13:51:00 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
ojeda@...nel.org, alex.gaynor@...il.com, gary@...yguo.net,
bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
a.hindborg@...sung.com, aliceryhl@...gle.com, tmgross@...ch.edu,
dakr@...nel.org, mingo@...hat.com, peterz@...radead.org,
juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com, pmladek@...e.com,
fujita.tomonori@...il.com, mingo@...nel.org, tamird@...il.com
Subject: Re: [PATCH v4 1/2] rust: Introduce file_from_location()
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@...il.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
Powered by blists - more mailing lists