2020-11-24 23:51:30

by Lee Jones

[permalink] [raw]
Subject: [PATCH 36/40] drm/amd/pm/inc/smu_v11_0: Mark 'smu11_thermal_policy' as __maybe_unused

It's used in some, but not all source files which include 'smu_v11_0.h'.

Fixes the following W=1 kernel build warning(s):

In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:36:
drivers/gpu/drm/amd/amdgpu/../pm/inc/smu_v11_0.h:61:43: warning: ‘smu11_thermal_policy’ defined but not used [-Wunused-const-variable=]
61 | static const struct smu_temperature_range smu11_thermal_policy[] =
| ^~~~~~~~~~~~~~~~~~~~

Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
index eff396c7a281f..9742a02e7b16b 100644
--- a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
+++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
@@ -58,7 +58,8 @@
#define CTF_OFFSET_HOTSPOT 5
#define CTF_OFFSET_MEM 5

-static const struct smu_temperature_range smu11_thermal_policy[] =
+static const
+struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
{
{-273150, 99000, 99000, -273150, 99000, 99000, -273150, 99000, 99000},
{ 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000},
--
2.25.1


2020-11-30 23:16:54

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH 36/40] drm/amd/pm/inc/smu_v11_0: Mark 'smu11_thermal_policy' as __maybe_unused

On Tue, Nov 24, 2020 at 2:45 PM Lee Jones <[email protected]> wrote:
>
> It's used in some, but not all source files which include 'smu_v11_0.h'.
>
> Fixes the following W=1 kernel build warning(s):
>
> In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/smu_v11_0.c:36:
> drivers/gpu/drm/amd/amdgpu/../pm/inc/smu_v11_0.h:61:43: warning: ‘smu11_thermal_policy’ defined but not used [-Wunused-const-variable=]
> 61 | static const struct smu_temperature_range smu11_thermal_policy[] =
> | ^~~~~~~~~~~~~~~~~~~~
>
> Cc: Alex Deucher <[email protected]>
> Cc: "Christian König" <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Applied. Thanks!

Alex

> ---
> drivers/gpu/drm/amd/pm/inc/smu_v11_0.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> index eff396c7a281f..9742a02e7b16b 100644
> --- a/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> +++ b/drivers/gpu/drm/amd/pm/inc/smu_v11_0.h
> @@ -58,7 +58,8 @@
> #define CTF_OFFSET_HOTSPOT 5
> #define CTF_OFFSET_MEM 5
>
> -static const struct smu_temperature_range smu11_thermal_policy[] =
> +static const
> +struct smu_temperature_range __maybe_unused smu11_thermal_policy[] =
> {
> {-273150, 99000, 99000, -273150, 99000, 99000, -273150, 99000, 99000},
> { 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000, 120000},
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel