linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] drm/amd/display: remove set but not used variable 'bpc'
@ 2019-11-09  9:35 YueHaibing
  2019-11-11 18:01 ` Alex Deucher
  2019-11-12  2:10 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 5+ messages in thread
From: YueHaibing @ 2019-11-09  9:35 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, Bhawanpreet.Lakha, Jun.Lei,
	Anthony.Koo, Zhan.Liu
  Cc: amd-gfx, dri-devel, linux-kernel, YueHaibing

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c: In function get_pbn_from_timing:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2364:11: warning:
 variable bpc set but not used [-Wunused-but-set-variable]

It is not used since commit e49f69363adf ("drm/amd/display: use
proper formula to calculate bandwidth from timing")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index bdc8be3..53394e2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -2653,13 +2653,11 @@ static int get_color_depth(enum dc_color_depth color_depth)
 
 static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
 {
-	uint32_t bpc;
 	uint64_t kbps;
 	struct fixed31_32 peak_kbps;
 	uint32_t numerator;
 	uint32_t denominator;
 
-	bpc = get_color_depth(pipe_ctx->stream_res.pix_clk_params.color_depth);
 	kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
 
 	/*
-- 
2.7.4



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

* Re: [PATCH -next] drm/amd/display: remove set but not used variable 'bpc'
  2019-11-09  9:35 [PATCH -next] drm/amd/display: remove set but not used variable 'bpc' YueHaibing
@ 2019-11-11 18:01 ` Alex Deucher
  2019-11-11 20:27   ` Alex Deucher
  2019-11-12  2:10 ` [PATCH v2 " YueHaibing
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2019-11-11 18:01 UTC (permalink / raw)
  To: YueHaibing
  Cc: Wentland, Harry, Leo (Sunpeng) Li, Deucher, Alexander,
	Christian Koenig, Chunming Zhou, Dave Airlie, Daniel Vetter,
	Bhawanpreet Lakha, Jun Lei, Anthony Koo, Zhan Liu,
	Maling list - DRI developers, amd-gfx list, LKML

Applied.  Thanks!

Alex

On Sun, Nov 10, 2019 at 9:30 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c: In function get_pbn_from_timing:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2364:11: warning:
>  variable bpc set but not used [-Wunused-but-set-variable]
>
> It is not used since commit e49f69363adf ("drm/amd/display: use
> proper formula to calculate bandwidth from timing")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index bdc8be3..53394e2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -2653,13 +2653,11 @@ static int get_color_depth(enum dc_color_depth color_depth)
>
>  static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
>  {
> -       uint32_t bpc;
>         uint64_t kbps;
>         struct fixed31_32 peak_kbps;
>         uint32_t numerator;
>         uint32_t denominator;
>
> -       bpc = get_color_depth(pipe_ctx->stream_res.pix_clk_params.color_depth);
>         kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
>
>         /*
> --
> 2.7.4
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH -next] drm/amd/display: remove set but not used variable 'bpc'
  2019-11-11 18:01 ` Alex Deucher
@ 2019-11-11 20:27   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2019-11-11 20:27 UTC (permalink / raw)
  To: YueHaibing
  Cc: Wentland, Harry, Leo (Sunpeng) Li, Deucher, Alexander,
	Christian Koenig, Chunming Zhou, Dave Airlie, Daniel Vetter,
	Bhawanpreet Lakha, Jun Lei, Anthony Koo, Zhan Liu,
	Maling list - DRI developers, amd-gfx list, LKML

On Mon, Nov 11, 2019 at 1:01 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> Applied.  Thanks!

I've dropped this as it leads to a warning in the code since
get_color_depth is no longer used.  Care to fix that up as well?

Thanks!

Alex

>
> Alex
>
> On Sun, Nov 10, 2019 at 9:30 PM YueHaibing <yuehaibing@huawei.com> wrote:
> >
> > Fixes gcc '-Wunused-but-set-variable' warning:
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c: In function get_pbn_from_timing:
> > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2364:11: warning:
> >  variable bpc set but not used [-Wunused-but-set-variable]
> >
> > It is not used since commit e49f69363adf ("drm/amd/display: use
> > proper formula to calculate bandwidth from timing")
> >
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index bdc8be3..53394e2 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -2653,13 +2653,11 @@ static int get_color_depth(enum dc_color_depth color_depth)
> >
> >  static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
> >  {
> > -       uint32_t bpc;
> >         uint64_t kbps;
> >         struct fixed31_32 peak_kbps;
> >         uint32_t numerator;
> >         uint32_t denominator;
> >
> > -       bpc = get_color_depth(pipe_ctx->stream_res.pix_clk_params.color_depth);
> >         kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
> >
> >         /*
> > --
> > 2.7.4
> >
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH v2 -next] drm/amd/display: remove set but not used variable 'bpc'
  2019-11-09  9:35 [PATCH -next] drm/amd/display: remove set but not used variable 'bpc' YueHaibing
  2019-11-11 18:01 ` Alex Deucher
@ 2019-11-12  2:10 ` YueHaibing
  2019-11-12 15:52   ` Alex Deucher
  1 sibling, 1 reply; 5+ messages in thread
From: YueHaibing @ 2019-11-12  2:10 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, daniel, Bhawanpreet.Lakha, Jun.Lei,
	Anthony.Koo, Zhan.Liu
  Cc: amd-gfx, dri-devel, linux-kernel, YueHaibing

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c: In function get_pbn_from_timing:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2364:11: warning:
 variable bpc set but not used [-Wunused-but-set-variable]

It is not used since commit e49f69363adf ("drm/amd/display: use
proper formula to calculate bandwidth from timing"), this also
remove get_color_depth(), which is only used here.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: also remove unused get_color_depth()
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index bdc8be3..1be4277 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -2638,28 +2638,13 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream)
 	return dc_fixpt_div_int(mbytes_per_sec, 54);
 }
 
-static int get_color_depth(enum dc_color_depth color_depth)
-{
-	switch (color_depth) {
-	case COLOR_DEPTH_666: return 6;
-	case COLOR_DEPTH_888: return 8;
-	case COLOR_DEPTH_101010: return 10;
-	case COLOR_DEPTH_121212: return 12;
-	case COLOR_DEPTH_141414: return 14;
-	case COLOR_DEPTH_161616: return 16;
-	default: return 0;
-	}
-}
-
 static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
 {
-	uint32_t bpc;
 	uint64_t kbps;
 	struct fixed31_32 peak_kbps;
 	uint32_t numerator;
 	uint32_t denominator;
 
-	bpc = get_color_depth(pipe_ctx->stream_res.pix_clk_params.color_depth);
 	kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
 
 	/*
-- 
2.7.4



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

* Re: [PATCH v2 -next] drm/amd/display: remove set but not used variable 'bpc'
  2019-11-12  2:10 ` [PATCH v2 " YueHaibing
@ 2019-11-12 15:52   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2019-11-12 15:52 UTC (permalink / raw)
  To: YueHaibing
  Cc: Wentland, Harry, Leo (Sunpeng) Li, Deucher, Alexander,
	Christian Koenig, Chunming Zhou, Dave Airlie, Daniel Vetter,
	Bhawanpreet Lakha, Jun Lei, Anthony Koo, Zhan Liu,
	Maling list - DRI developers, amd-gfx list, LKML

On Tue, Nov 12, 2019 at 3:13 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c: In function get_pbn_from_timing:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:2364:11: warning:
>  variable bpc set but not used [-Wunused-but-set-variable]
>
> It is not used since commit e49f69363adf ("drm/amd/display: use
> proper formula to calculate bandwidth from timing"), this also
> remove get_color_depth(), which is only used here.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.  Thanks!

Alex

> ---
> v2: also remove unused get_color_depth()
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 ---------------
>  1 file changed, 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index bdc8be3..1be4277 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -2638,28 +2638,13 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream)
>         return dc_fixpt_div_int(mbytes_per_sec, 54);
>  }
>
> -static int get_color_depth(enum dc_color_depth color_depth)
> -{
> -       switch (color_depth) {
> -       case COLOR_DEPTH_666: return 6;
> -       case COLOR_DEPTH_888: return 8;
> -       case COLOR_DEPTH_101010: return 10;
> -       case COLOR_DEPTH_121212: return 12;
> -       case COLOR_DEPTH_141414: return 14;
> -       case COLOR_DEPTH_161616: return 16;
> -       default: return 0;
> -       }
> -}
> -
>  static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
>  {
> -       uint32_t bpc;
>         uint64_t kbps;
>         struct fixed31_32 peak_kbps;
>         uint32_t numerator;
>         uint32_t denominator;
>
> -       bpc = get_color_depth(pipe_ctx->stream_res.pix_clk_params.color_depth);
>         kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
>
>         /*
> --
> 2.7.4
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-11-12 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-09  9:35 [PATCH -next] drm/amd/display: remove set but not used variable 'bpc' YueHaibing
2019-11-11 18:01 ` Alex Deucher
2019-11-11 20:27   ` Alex Deucher
2019-11-12  2:10 ` [PATCH v2 " YueHaibing
2019-11-12 15:52   ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).