[libdrm,1/2] amdgpu: Move union declaration to top of amdgpu_cs_ctx_override_priority

Submitted by Michel Dänzer on June 24, 2019, 3:45 p.m.

Details

Message ID 20190624154535.8619-2-michel@daenzer.net
State Accepted
Commit e246114c46140589ae95dfa3f517d59e853667d1
Headers show
Series "amdgpu: Minor cleanups" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Michel Dänzer June 24, 2019, 3:45 p.m.
From: Michel Dänzer <michel.daenzer@amd.com>

Avoids compiler warning:

../../amdgpu/amdgpu_cs.c: In function 'amdgpu_cs_ctx_override_priority':
../../amdgpu/amdgpu_cs.c:155:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  union drm_amdgpu_sched args;
  ^~~~~

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 amdgpu/amdgpu_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 977fa3cf..20d5aef2 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -147,12 +147,12 @@  drm_public int amdgpu_cs_ctx_override_priority(amdgpu_device_handle dev,
                                                int master_fd,
                                                unsigned priority)
 {
+	union drm_amdgpu_sched args;
 	int r;
 
 	if (!dev || !context || master_fd < 0)
 		return -EINVAL;
 
-	union drm_amdgpu_sched args;
 	memset(&args, 0, sizeof(args));
 
 	args.in.op = AMDGPU_SCHED_OP_CONTEXT_PRIORITY_OVERRIDE;