NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Eliot Courtney <ecourtney@nvidia.com>,
	Danilo Krummrich <dakr@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Alexandre Courbot <acourbot@nvidia.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: Alistair Popple <apopple@nvidia.com>,
	Timur Tabi <ttabi@nvidia.com>,
	nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpu: nova-core: switch NVKV dead_code attributes from expect to allow
Date: Fri, 4 Dec 2026 17:22:09 -0800	[thread overview]
Message-ID: <dd2ce35a-1517-483d-aaeb-4ce83f5912d3@nvidia.com> (raw)
In-Reply-To: <20261204-nvkv-build-fix-v1-1-72b42a776511@nvidia.com>

On 12/3/26 11:18 PM, Eliot Courtney wrote:
> Once the r000 GSP_INIT command uses the NVKV encoder and decoder outside
> of KUnit tests, rustc before 1.97.0 warns without `CONFIG_KUNIT=y` that
> the `expect(dead_code)` at the top of encode.rs and decode.rs is
> unfulfilled:

Might be nice to add here: 

"That's because of a bug in rust..."

Either way,

Reviewed-by: John Hubbard <jhubbard@nvidia.com>

thanks,
-- 
John Hubbard
> 
>     warning: this lint expectation is unfulfilled
>      --> drivers/gpu/nova-core/gsp/nvkv/encode.rs:4:45
> 
>     warning: this lint expectation is unfulfilled
>      --> drivers/gpu/nova-core/gsp/nvkv/decode.rs:4:45
> 
> Switch both files from `expect(dead_code)` to `allow(dead_code)`. Once
> GSP_INIT is merged, we can remove the attribute from encode.rs.
> 
> Reported-by: Timur Tabi <ttabi@nvidia.com>
> Closes: https://lore.kernel.org/all/1f88322ae5c6d879b293b2f2a96a36413dbafef3.camel@nvidia.com/
> Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
> ---
> This is a prerequisite for [1], which adds the GSP_INIT command and hits
> build errors for rustc before 1.97.0.
> 
> This is based on drm-rust-next.
> 
> [1]: https://lore.kernel.org/all/20261203-b4-r000-switch-v1-0-b1463ec6dae2@nvidia.com/
> ---
>  drivers/gpu/nova-core/gsp/nvkv/decode.rs | 4 +++-
>  drivers/gpu/nova-core/gsp/nvkv/encode.rs | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/nova-core/gsp/nvkv/decode.rs b/drivers/gpu/nova-core/gsp/nvkv/decode.rs
> index 84c0c998b2c9..8445ac96c66c 100644
> --- a/drivers/gpu/nova-core/gsp/nvkv/decode.rs
> +++ b/drivers/gpu/nova-core/gsp/nvkv/decode.rs
> @@ -1,7 +1,9 @@
>  // SPDX-License-Identifier: GPL-2.0
>  // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>  
> -#![cfg_attr(not(CONFIG_KUNIT = "y"), expect(dead_code))]
> +// TODO: expect() doesn't work here before rustc 1.97.0
> +// https://github.com/rust-lang/rust/pull/154377
> +#![cfg_attr(not(CONFIG_KUNIT = "y"), allow(dead_code))]
>  
>  use core::marker::PhantomData;
>  
> diff --git a/drivers/gpu/nova-core/gsp/nvkv/encode.rs b/drivers/gpu/nova-core/gsp/nvkv/encode.rs
> index c6891c0441ff..fa9e0421af79 100644
> --- a/drivers/gpu/nova-core/gsp/nvkv/encode.rs
> +++ b/drivers/gpu/nova-core/gsp/nvkv/encode.rs
> @@ -1,7 +1,9 @@
>  // SPDX-License-Identifier: GPL-2.0
>  // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
>  
> -#![cfg_attr(not(CONFIG_KUNIT = "y"), expect(dead_code))]
> +// TODO: expect() doesn't work here before rustc 1.97.0
> +// https://github.com/rust-lang/rust/pull/154377
> +#![cfg_attr(not(CONFIG_KUNIT = "y"), allow(dead_code))]
>  
>  use kernel::prelude::*;
>  use zerocopy::Immutable;
> 
> ---
> base-commit: d9da44362d77bcbf1f5bfd2ba1c514e776fdb07c
> change-id: 20261124-nvkv-build-fix-5d7bb239fff3
> 
> Best regards,
> --  
> Eliot Courtney <ecourtney@nvidia.com>



      reply	other threads:[~2026-12-05  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  7:18 [PATCH] gpu: nova-core: switch NVKV dead_code attributes from expect to allow Eliot Courtney
2026-12-05  1:22 ` John Hubbard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd2ce35a-1517-483d-aaeb-4ce83f5912d3@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ecourtney@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=simona@ffwll.ch \
    --cc=ttabi@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox