drm/amdgpu: some code refinement v2
authorJammy Zhou <Jammy.Zhou@amd.com>
Thu, 30 Jul 2015 09:19:52 +0000 (17:19 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2015 20:50:56 +0000 (16:50 -0400)
Fix the code alignment, etc.

v2: rebase the code

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c

index aee59110735fe178f0b69058f3286b7a82a23601..fda7792d9e08d1c6fd88eff0fb922210e2cc2c90 100644 (file)
@@ -817,14 +817,14 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev,
 
 static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job)
 {
-        int r, i;
+       int r, i;
        struct amdgpu_cs_parser *parser = sched_job;
        struct amdgpu_device *adev = sched_job->adev;
-        bool reserved_buffers = false;
+       bool reserved_buffers = false;
 
-        r = amdgpu_cs_parser_relocs(parser);
-        if (r) {
-                if (r != -ERESTARTSYS) {
+       r = amdgpu_cs_parser_relocs(parser);
+       if (r) {
+               if (r != -ERESTARTSYS) {
                        if (r == -ENOMEM)
                                DRM_ERROR("Not enough memory for command submission!\n");
                        else
@@ -841,16 +841,16 @@ static int amdgpu_cs_parser_prepare_job(struct amdgpu_cs_parser *sched_job)
                if (r)
                        DRM_ERROR("Failed in the dependencies handling %d!\n", r);
        }
-        if (r) {
-                amdgpu_cs_parser_fini(parser, r, reserved_buffers);
-               return r;
-        }
+       if (r) {
+               amdgpu_cs_parser_fini(parser, r, reserved_buffers);
+               return r;
+       }
 
-        for (i = 0; i < parser->num_ibs; i++)
-                trace_amdgpu_cs(parser, i);
+       for (i = 0; i < parser->num_ibs; i++)
+               trace_amdgpu_cs(parser, i);
 
-       r = amdgpu_cs_ib_vm_chunk(adev, parser);
-       return r;
+       r = amdgpu_cs_ib_vm_chunk(adev, parser);
+       return r;
 }
 
 static struct amdgpu_ring *amdgpu_cs_parser_get_ring(
index 0f55c05c80b1b0a26d5b9e370e1943149e1897a8..788dd348a650f87c1bd065989215465c612faa17 100644 (file)
@@ -33,11 +33,12 @@ static int amdgpu_sched_prepare_job(struct amd_gpu_scheduler *sched,
 {
        int r = 0;
        struct amdgpu_cs_parser *sched_job = (struct amdgpu_cs_parser *)job;
-       if (sched_job->prepare_job)
+       if (sched_job->prepare_job) {
                r = sched_job->prepare_job(sched_job);
-       if (r) {
-               DRM_ERROR("Prepare job error\n");
-               schedule_work(&sched_job->job_work);
+               if (r) {
+                       DRM_ERROR("Prepare job error\n");
+                       schedule_work(&sched_job->job_work);
+               }
        }
        return r;
 }