[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250714104322.100511-3-krakow20@gmail.com>
Date: Mon, 14 Jul 2025 03:43:14 -0700
From: Rhys Lloyd <krakow20@...il.com>
To: acourbot@...dia.com,
dakr@...nel.org
Cc: Rhys Lloyd <krakow20@...il.com>,
rust-for-linux@...r.kernel.org,
airlied@...il.com,
simona@...ll.ch,
nouveau@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] gpu: nova-core: vbios: use size_of instead of magic number
12 is identical to the value of `size_of::<BitHeader>()`,
so use the latter instead.
Signed-off-by: Rhys Lloyd <krakow20@...il.com>
---
drivers/gpu/nova-core/vbios.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
index 663fc50e8b66..ac35415b4ffb 100644
--- a/drivers/gpu/nova-core/vbios.rs
+++ b/drivers/gpu/nova-core/vbios.rs
@@ -365,7 +365,7 @@ struct BitHeader {
impl BitHeader {
fn new(data: &[u8]) -> Result<Self> {
- if data.len() < 12 {
+ if data.len() < core::mem::size_of::<Self>() {
return Err(EINVAL);
}
base-commit: 215a3f91713383a3c0d2da82d223a608a3c17ac1
--
2.50.1
Powered by blists - more mailing lists