* [PATCH] gpu: nova-core: firmware: use ENODATA for empty TLV values
@ 2026-12-02 8:53 Ivan Tverdokhleb
0 siblings, 0 replies; only message 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] only message in thread
only message in thread, other threads:[~2026-12-02 8:54 UTC | newest]
Thread overview: (only message) (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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox