Message ID | 20230213204923.111948-10-arthurgrillo@riseup.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Resolve warnings from AMDGPU | expand |
Applied. Thanks! On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote: > > Make variables declaration inside ifdef guard, as they are only used > inside the same ifdef guard. This remove some of the > -Wunused-but-set-variable warning. > > Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> > --- > .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 4 ++++ > .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c > index ec351c8418cb..27f488405335 100644 > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c > @@ -878,7 +878,9 @@ static bool CalculatePrefetchSchedule( > double DSTTotalPixelsAfterScaler; > double LineTime; > double dst_y_prefetch_equ; > +#ifdef __DML_VBA_DEBUG__ > double Tsw_oto; > +#endif > double prefetch_bw_oto; > double prefetch_bw_pr; > double Tvm_oto; > @@ -1060,7 +1062,9 @@ static bool CalculatePrefetchSchedule( > > min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre); > Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4; > +#ifdef __DML_VBA_DEBUG__ > Tsw_oto = Lsw_oto * LineTime; > +#endif > > > #ifdef __DML_VBA_DEBUG__ > diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c > index 950669f2c10d..0fd3889c2061 100644 > --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c > +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c > @@ -900,7 +900,9 @@ static bool CalculatePrefetchSchedule( > double DSTTotalPixelsAfterScaler; > double LineTime; > double dst_y_prefetch_equ; > +#ifdef __DML_VBA_DEBUG__ > double Tsw_oto; > +#endif > double prefetch_bw_oto; > double prefetch_bw_pr; > double Tvm_oto; > @@ -1082,7 +1084,9 @@ static bool CalculatePrefetchSchedule( > > min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre); > Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4; > +#ifdef __DML_VBA_DEBUG__ > Tsw_oto = Lsw_oto * LineTime; > +#endif > > > #ifdef __DML_VBA_DEBUG__ > -- > 2.39.1 >
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c index ec351c8418cb..27f488405335 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c @@ -878,7 +878,9 @@ static bool CalculatePrefetchSchedule( double DSTTotalPixelsAfterScaler; double LineTime; double dst_y_prefetch_equ; +#ifdef __DML_VBA_DEBUG__ double Tsw_oto; +#endif double prefetch_bw_oto; double prefetch_bw_pr; double Tvm_oto; @@ -1060,7 +1062,9 @@ static bool CalculatePrefetchSchedule( min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre); Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4; +#ifdef __DML_VBA_DEBUG__ Tsw_oto = Lsw_oto * LineTime; +#endif #ifdef __DML_VBA_DEBUG__ diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c index 950669f2c10d..0fd3889c2061 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c @@ -900,7 +900,9 @@ static bool CalculatePrefetchSchedule( double DSTTotalPixelsAfterScaler; double LineTime; double dst_y_prefetch_equ; +#ifdef __DML_VBA_DEBUG__ double Tsw_oto; +#endif double prefetch_bw_oto; double prefetch_bw_pr; double Tvm_oto; @@ -1082,7 +1084,9 @@ static bool CalculatePrefetchSchedule( min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre); Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4; +#ifdef __DML_VBA_DEBUG__ Tsw_oto = Lsw_oto * LineTime; +#endif #ifdef __DML_VBA_DEBUG__
Make variables declaration inside ifdef guard, as they are only used inside the same ifdef guard. This remove some of the -Wunused-but-set-variable warning. Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net> --- .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c | 4 ++++ .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c | 4 ++++ 2 files changed, 8 insertions(+)