Skip to contentSkip to conversation

drm/amd/display: remove set but not used variable 'bpc'

PATCH Applied YueHaibing 2 participants 5 messages Nov 9, 2019 – Nov 12, 2019

Subsystems (3)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 drm/amd/display: remove set but not used variable 'bpc'

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")

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -2
index bdc8be3..53394e2 100644
@@ -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);
 
 	/*
Signature · 1 line
2.7.4
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 41 lines · 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")

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -3
index bdc8be3..53394e2 100644
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 2 lines · Alex Deucher

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

Quoted 41 lines

Alex

Quoted 37 lines · 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")

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -3
index bdc8be3..53394e2 100644
@@ -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

Quoted 4 lines
Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author
#3 lore raw

PATCH v2 1/1 drm/amd/display: remove set but not used variable 'bpc'

In reply to 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.

---
v2: also remove unused get_color_depth()

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -15
index bdc8be3..1be4277 100644
@@ -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);
 
 	/*
Signature · 1 line
2.7.4
Applied
#4 lore raw
Quoted 7 lines · 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]

Quoted 5 lines

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.

Applied. Thanks!

Alex

Quoted 43 lines

---
v2: also remove unused get_color_depth()

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -16
index bdc8be3..1be4277 100644
@@ -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

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel