Skip to content

Commit f645d22

Browse files
zhiwang1jnikula
authored andcommitted
drm/i915/gvt: remove unused variable gma_bottom in command parser
Remove unused variable gma_bottom in scan_workload() and scan_wa_ctx(). commit be1da70 ("drm/i915/gvt: vGPU command scanner") introduces gma_bottom in several functions to calculate the size of the command buffer. However, some of them are set but actually unused. When compiling the code with ccflags -Wunused-but-set-variable, gcc throws warnings. Remove unused variables to avoid the gcc warnings. Tested via compiling the code with ccflags -Wunused-but-set-variable. Fixes: be1da70 ("drm/i915/gvt: vGPU command scanner") Suggested-by: Jani Nikula <[email protected]> Cc: Zhenyu Wang <[email protected]> Cc: [email protected] Signed-off-by: Zhi Wang <[email protected]> Reviewed-by: Zhenyu Wang <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5e0bff2 commit f645d22

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/i915/gvt/cmd_parser.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,7 @@ static int command_scan(struct parser_exec_state *s,
28332833

28342834
static int scan_workload(struct intel_vgpu_workload *workload)
28352835
{
2836-
unsigned long gma_head, gma_tail, gma_bottom;
2836+
unsigned long gma_head, gma_tail;
28372837
struct parser_exec_state s;
28382838
int ret = 0;
28392839

@@ -2843,7 +2843,6 @@ static int scan_workload(struct intel_vgpu_workload *workload)
28432843

28442844
gma_head = workload->rb_start + workload->rb_head;
28452845
gma_tail = workload->rb_start + workload->rb_tail;
2846-
gma_bottom = workload->rb_start + _RING_CTL_BUF_SIZE(workload->rb_ctl);
28472846

28482847
s.buf_type = RING_BUFFER_INSTRUCTION;
28492848
s.buf_addr_type = GTT_BUFFER;
@@ -2874,7 +2873,7 @@ static int scan_workload(struct intel_vgpu_workload *workload)
28742873
static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
28752874
{
28762875

2877-
unsigned long gma_head, gma_tail, gma_bottom, ring_size, ring_tail;
2876+
unsigned long gma_head, gma_tail, ring_size, ring_tail;
28782877
struct parser_exec_state s;
28792878
int ret = 0;
28802879
struct intel_vgpu_workload *workload = container_of(wa_ctx,
@@ -2891,7 +2890,6 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
28912890
PAGE_SIZE);
28922891
gma_head = wa_ctx->indirect_ctx.guest_gma;
28932892
gma_tail = wa_ctx->indirect_ctx.guest_gma + ring_tail;
2894-
gma_bottom = wa_ctx->indirect_ctx.guest_gma + ring_size;
28952893

28962894
s.buf_type = RING_BUFFER_INSTRUCTION;
28972895
s.buf_addr_type = GTT_BUFFER;

0 commit comments

Comments
 (0)