mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: change several dcn20 variables storage-class-specifier to static
@ 2023-03-04 16:22 Tom Rix
  2023-03-06 19:40 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Rix @ 2023-03-04 16:22 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, alvin.lee2,
	javierm, hamza.mahfooz, eric.bernstein, roman.li, wenjing.liu,
	praful.swarnakar, tzimmermann, jiapeng.chong, Pavle.Kotarac,
	hansen.dsouza, Charlene.Liu, Josip.Pavic, Jun.Lei,
	chiahsuan.chung
  Cc: amd-gfx, dri-devel, linux-kernel, Tom Rix

smatch reports these similar problems in dcn20
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dsc.c:53:24:
  warning: symbol 'dcn20_dsc_funcs' was not declared. Should it be static?
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb.c:304:25:
  warning: symbol 'dcn20_dwbc_funcs' was not declared. Should it be static?
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_mmhubbub.c:300:28:
  warning: symbol 'dcn20_mmhubbub_funcs' was not declared. Should it be static?
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_mpc.c:545:24:
  warning: symbol 'dcn20_mpc_funcs' was not declared. Should it be static?

All of these are only used in their definition file, so they should be static

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c      | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c      | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
index 42344aec60d6..5bd698cd6d20 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
@@ -50,7 +50,7 @@ static void dsc2_enable(struct display_stream_compressor *dsc, int opp_pipe);
 static void dsc2_disable(struct display_stream_compressor *dsc);
 static void dsc2_disconnect(struct display_stream_compressor *dsc);
 
-const struct dsc_funcs dcn20_dsc_funcs = {
+static const struct dsc_funcs dcn20_dsc_funcs = {
 	.dsc_get_enc_caps = dsc2_get_enc_caps,
 	.dsc_read_state = dsc2_read_state,
 	.dsc_validate_stream = dsc2_validate_stream,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
index f1490e97b6ce..f8667be57046 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
@@ -301,7 +301,7 @@ void dwb2_set_scaler(struct dwbc *dwbc, struct dc_dwb_params *params)
 
 }
 
-const struct dwbc_funcs dcn20_dwbc_funcs = {
+static const struct dwbc_funcs dcn20_dwbc_funcs = {
 	.get_caps		= dwb2_get_caps,
 	.enable			= dwb2_enable,
 	.disable		= dwb2_disable,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
index ccd91792991b..259a98e4ee2c 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
@@ -297,7 +297,7 @@ void mcifwb2_dump_frame(struct mcif_wb *mcif_wb,
 	dump_info->size		= dest_height * (mcif_params->luma_pitch + mcif_params->chroma_pitch);
 }
 
-const struct mcif_wb_funcs dcn20_mmhubbub_funcs = {
+static const struct mcif_wb_funcs dcn20_mmhubbub_funcs = {
 	.enable_mcif		= mmhubbub2_enable_mcif,
 	.disable_mcif		= mmhubbub2_disable_mcif,
 	.config_mcif_buf	= mmhubbub2_config_mcif_buf,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
index 116f67a0b989..5da6e44f284a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
@@ -542,7 +542,7 @@ static struct mpcc *mpc2_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id)
 	return NULL;
 }
 
-const struct mpc_funcs dcn20_mpc_funcs = {
+static const struct mpc_funcs dcn20_mpc_funcs = {
 	.read_mpcc_state = mpc1_read_mpcc_state,
 	.insert_plane = mpc1_insert_plane,
 	.remove_mpcc = mpc1_remove_mpcc,
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amd/display: change several dcn20 variables storage-class-specifier to static
  2023-03-04 16:22 [PATCH] drm/amd/display: change several dcn20 variables storage-class-specifier to static Tom Rix
@ 2023-03-06 19:40 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-03-06 19:40 UTC (permalink / raw)
  To: Tom Rix
  Cc: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, alvin.lee2,
	javierm, hamza.mahfooz, eric.bernstein, roman.li, wenjing.liu,
	praful.swarnakar, tzimmermann, jiapeng.chong, Pavle.Kotarac,
	hansen.dsouza, Charlene.Liu, Josip.Pavic, Jun.Lei,
	chiahsuan.chung, dri-devel, amd-gfx, linux-kernel

Applied.  Thanks!

Alex

On Sat, Mar 4, 2023 at 11:22 AM Tom Rix <trix@redhat.com> wrote:
>
> smatch reports these similar problems in dcn20
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dsc.c:53:24:
>   warning: symbol 'dcn20_dsc_funcs' was not declared. Should it be static?
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_dwb.c:304:25:
>   warning: symbol 'dcn20_dwbc_funcs' was not declared. Should it be static?
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_mmhubbub.c:300:28:
>   warning: symbol 'dcn20_mmhubbub_funcs' was not declared. Should it be static?
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn20/dcn20_mpc.c:545:24:
>   warning: symbol 'dcn20_mpc_funcs' was not declared. Should it be static?
>
> All of these are only used in their definition file, so they should be static
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c      | 2 +-
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c      | 2 +-
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c      | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> index 42344aec60d6..5bd698cd6d20 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c
> @@ -50,7 +50,7 @@ static void dsc2_enable(struct display_stream_compressor *dsc, int opp_pipe);
>  static void dsc2_disable(struct display_stream_compressor *dsc);
>  static void dsc2_disconnect(struct display_stream_compressor *dsc);
>
> -const struct dsc_funcs dcn20_dsc_funcs = {
> +static const struct dsc_funcs dcn20_dsc_funcs = {
>         .dsc_get_enc_caps = dsc2_get_enc_caps,
>         .dsc_read_state = dsc2_read_state,
>         .dsc_validate_stream = dsc2_validate_stream,
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
> index f1490e97b6ce..f8667be57046 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb.c
> @@ -301,7 +301,7 @@ void dwb2_set_scaler(struct dwbc *dwbc, struct dc_dwb_params *params)
>
>  }
>
> -const struct dwbc_funcs dcn20_dwbc_funcs = {
> +static const struct dwbc_funcs dcn20_dwbc_funcs = {
>         .get_caps               = dwb2_get_caps,
>         .enable                 = dwb2_enable,
>         .disable                = dwb2_disable,
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
> index ccd91792991b..259a98e4ee2c 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mmhubbub.c
> @@ -297,7 +297,7 @@ void mcifwb2_dump_frame(struct mcif_wb *mcif_wb,
>         dump_info->size         = dest_height * (mcif_params->luma_pitch + mcif_params->chroma_pitch);
>  }
>
> -const struct mcif_wb_funcs dcn20_mmhubbub_funcs = {
> +static const struct mcif_wb_funcs dcn20_mmhubbub_funcs = {
>         .enable_mcif            = mmhubbub2_enable_mcif,
>         .disable_mcif           = mmhubbub2_disable_mcif,
>         .config_mcif_buf        = mmhubbub2_config_mcif_buf,
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> index 116f67a0b989..5da6e44f284a 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c
> @@ -542,7 +542,7 @@ static struct mpcc *mpc2_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id)
>         return NULL;
>  }
>
> -const struct mpc_funcs dcn20_mpc_funcs = {
> +static const struct mpc_funcs dcn20_mpc_funcs = {
>         .read_mpcc_state = mpc1_read_mpcc_state,
>         .insert_plane = mpc1_insert_plane,
>         .remove_mpcc = mpc1_remove_mpcc,
> --
> 2.27.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-06 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-04 16:22 [PATCH] drm/amd/display: change several dcn20 variables storage-class-specifier to static Tom Rix
2023-03-06 19:40 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®