* [PATCH] gpu: nova-core: firmware: use ENODATA for empty TLV values
@ 2026-12-02 8:53 Ivan Tverdokhleb
2026-12-04 9:54 ` Alexandre Courbot
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Tverdokhleb @ 2026-12-02 8:53 UTC (permalink / raw)
To: rust-for-linux, nova-gpu
Cc: dri-devel, Ivan Tverdokhleb, Danilo Krummrich, Alice Ryhl,
Alexandre Courbot, David Airlie, Simona Vetter, Miguel Ojeda,
Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
Andreas Hindborg, Trevor Gross, Daniel Almeida, Tamir Duberstein,
Onur Özkan
Tlv::get_bytes() returns EINVAL when a tag is present but its
value is empty, with a TODO to use ENODATA once available.
ENODATA is now defined in rust/kernel/error.rs, so return it instead
and update the doc comment accordingly.
Signed-off-by: Ivan Tverdokhleb <mbkchelofficialdev@gmail.com>
---
Based on next-20261118. Build-tested on x86_64 with CONFIG_RUST=y and
CONFIG_NOVA_CORE=y; not tested at runtime.
drivers/gpu/nova-core/firmware/tlv.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/nova-core/firmware/tlv.rs b/drivers/gpu/nova-core/firmware/tlv.rs
index 7b879f13a..cb58b1ede 100644
--- a/drivers/gpu/nova-core/firmware/tlv.rs
+++ b/drivers/gpu/nova-core/firmware/tlv.rs
@@ -200,13 +200,13 @@ fn iter(&self) -> TlvIter<'_, 'a> {
/// Return a slice of bytes.
///
- /// Returns `EINVAL` if the value is empty.
+ /// Returns `ENODATA` if the value is empty.
pub(crate) fn get_bytes(&self, tag: &[u8; 4]) -> Result<&'a [u8]> {
let tlv = self.find(tag)?;
// Treat empty value as an error, to avoid trying to parse nothing.
if tlv.value.is_empty() {
- return Err(EINVAL); // TODO: Use ENODATA once available.
+ return Err(ENODATA);
}
Ok(tlv.value)
--
2.56.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gpu: nova-core: firmware: use ENODATA for empty TLV values
2026-12-02 8:53 [PATCH] gpu: nova-core: firmware: use ENODATA for empty TLV values Ivan Tverdokhleb
@ 2026-12-04 9:54 ` Alexandre Courbot
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Courbot @ 2026-12-04 9:54 UTC (permalink / raw)
To: Ivan Tverdokhleb
Cc: rust-for-linux, nova-gpu, dri-devel, Danilo Krummrich, Alice Ryhl,
David Airlie, Simona Vetter, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Tamir Duberstein, Onur Özkan
On Wed Dec 2, 2026 at 5:53 PM JST, Ivan Tverdokhleb wrote:
> Tlv::get_bytes() returns EINVAL when a tag is present but its
> value is empty, with a TODO to use ENODATA once available.
>
> ENODATA is now defined in rust/kernel/error.rs, so return it instead
> and update the doc comment accordingly.
>
> Signed-off-by: Ivan Tverdokhleb <mbkchelofficialdev@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Thanks, I'll push this soon unless someone screams.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 9:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 8:53 [PATCH] gpu: nova-core: firmware: use ENODATA for empty TLV values Ivan Tverdokhleb
2026-12-04 9:54 ` Alexandre Courbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox