[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFHHP3LVYW43.247TW37BCGYHE@kernel.org>
Date: Tue, 06 Jan 2026 13:02:51 +0100
From: "Danilo Krummrich" <dakr@...nel.org>
To: "John Hubbard" <jhubbard@...dia.com>
Cc: "Alexandre Courbot" <acourbot@...dia.com>, "Joel Fernandes"
<joelagnelf@...dia.com>, "Timur Tabi" <ttabi@...dia.com>, "Alistair Popple"
<apopple@...dia.com>, "Edwin Peer" <epeer@...dia.com>, "Zhi Wang"
<zhiw@...dia.com>, "David Airlie" <airlied@...il.com>, "Simona Vetter"
<simona@...ll.ch>, "Bjorn Helgaas" <bhelgaas@...gle.com>, "Miguel Ojeda"
<ojeda@...nel.org>, "Alex Gaynor" <alex.gaynor@...il.com>, "Boqun Feng"
<boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
<lossin@...nel.org>, "Andreas Hindborg" <a.hindborg@...nel.org>, "Alice
Ryhl" <aliceryhl@...gle.com>, "Trevor Gross" <tmgross@...ch.edu>,
<nouveau@...ts.freedesktop.org>, <rust-for-linux@...r.kernel.org>, "LKML"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpu: nova-core: use CStr::from_bytes_until_nul() and
remove util.rs
On Sat Jan 3, 2026 at 2:34 AM CET, John Hubbard wrote:
> @@ -209,7 +208,9 @@ impl GetGspStaticInfoReply {
> /// Returns the name of the GPU as a string, or `None` if the string given by the GSP was
> /// invalid.
> pub(crate) fn gpu_name(&self) -> Option<&str> {
> - util::str_from_null_terminated(&self.gpu_name)
> + CStr::from_bytes_until_nul(&self.gpu_name)
> + .ok()
> + .and_then(|cstr| cstr.to_str().ok())
> }
> }
Did you see my reply in [1]? The question is orthogonal to this change, but
perhaps it can be addressed with a subsequent patch?
[1] https://lore.kernel.org/lkml/DFEVITW4O9DW.P4ITE1PWIDY6@kernel.org/
Powered by blists - more mailing lists