drm/radeon: delete useless function return values & remove meaningless if(r) check...
authorBernard Zhao <bernard@vivo.com>
Mon, 21 Jun 2021 13:05:07 +0000 (06:05 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 22 Jun 2021 20:51:45 +0000 (16:51 -0400)
Function radeon_fence_driver_init always returns success,
the function type maybe coule be changed to void.
This patch first delete the check of the return
value of the function call radeon_fence_driver_init, then,
optimise the function declaration and function to void type.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bernard Zhao <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
16 files changed:
drivers/gpu/drm/radeon/cik.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_fence.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/radeon/si.c

index 73ea518..81b4de7 100644 (file)
@@ -8584,9 +8584,7 @@ int cik_init(struct radeon_device *rdev)
        radeon_get_clock_info(rdev->ddev);
 
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
 
        /* initialize memory controller */
        r = cik_mc_init(rdev);
index 8e9e88b..36a888e 100644 (file)
@@ -5208,9 +5208,7 @@ int evergreen_init(struct radeon_device *rdev)
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* initialize AGP */
        if (rdev->flags & RADEON_IS_AGP) {
                r = radeon_agp_init(rdev);
index ab7bd30..4a364ca 100644 (file)
@@ -2375,9 +2375,7 @@ int cayman_init(struct radeon_device *rdev)
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* initialize memory controller */
        r = evergreen_mc_init(rdev);
        if (r)
index 3c4e7c1..ba72419 100644 (file)
@@ -4056,9 +4056,7 @@ int r100_init(struct radeon_device *rdev)
        /* initialize VRAM */
        r100_mc_init(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 92643df..621ff17 100644 (file)
@@ -1549,9 +1549,7 @@ int r300_init(struct radeon_device *rdev)
        /* initialize memory controller */
        r300_mc_init(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 1ed4407..7e6320e 100644 (file)
@@ -425,10 +425,7 @@ int r420_init(struct radeon_device *rdev)
        r300_mc_init(rdev);
        r420_debugfs(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r) {
-               return r;
-       }
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r) {
index fc78e64..6cbcaa8 100644 (file)
@@ -299,9 +299,7 @@ int r520_init(struct radeon_device *rdev)
        r520_mc_init(rdev);
        rv515_debugfs(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 7444dc0..ca3fcae 100644 (file)
@@ -3282,9 +3282,7 @@ int r600_init(struct radeon_device *rdev)
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        if (rdev->flags & RADEON_IS_AGP) {
                r = radeon_agp_init(rdev);
                if (r)
index 65301d6..895776c 100644 (file)
@@ -385,7 +385,7 @@ struct radeon_fence {
 };
 
 int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring);
-int radeon_fence_driver_init(struct radeon_device *rdev);
+void radeon_fence_driver_init(struct radeon_device *rdev);
 void radeon_fence_driver_fini(struct radeon_device *rdev);
 void radeon_fence_driver_force_completion(struct radeon_device *rdev, int ring);
 int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring);
index 0d8ef23..b2ce642 100644 (file)
@@ -905,9 +905,8 @@ static void radeon_fence_driver_init_ring(struct radeon_device *rdev, int ring)
  * Not all asics have all rings, so each asic will only
  * start the fence driver on the rings it has using
  * radeon_fence_driver_start_ring().
- * Returns 0 for success.
  */
-int radeon_fence_driver_init(struct radeon_device *rdev)
+void radeon_fence_driver_init(struct radeon_device *rdev)
 {
        int ring;
 
@@ -917,8 +916,6 @@ int radeon_fence_driver_init(struct radeon_device *rdev)
        }
 
        radeon_debugfs_fence_init(rdev);
-
-       return 0;
 }
 
 /**
index 8423bcc..6383f7a 100644 (file)
@@ -555,9 +555,7 @@ int rs400_init(struct radeon_device *rdev)
        /* initialize memory controller */
        rs400_mc_init(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 5bf2605..b2d22e2 100644 (file)
@@ -1132,9 +1132,7 @@ int rs600_init(struct radeon_device *rdev)
        rs600_mc_init(rdev);
        r100_debugfs_rbbm_init(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 7bc302a..14fb081 100644 (file)
@@ -850,9 +850,7 @@ int rs690_init(struct radeon_device *rdev)
        rs690_mc_init(rdev);
        rv515_debugfs(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 46a53dd..63fb06e 100644 (file)
@@ -648,9 +648,7 @@ int rv515_init(struct radeon_device *rdev)
        rv515_mc_init(rdev);
        rv515_debugfs(rdev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* Memory manager */
        r = radeon_bo_init(rdev);
        if (r)
index 88e29eb..7449930 100644 (file)
@@ -1941,9 +1941,7 @@ int rv770_init(struct radeon_device *rdev)
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
        /* initialize AGP */
        if (rdev->flags & RADEON_IS_AGP) {
                r = radeon_agp_init(rdev);
index d0e94b1..013e44e 100644 (file)
@@ -6857,9 +6857,7 @@ int si_init(struct radeon_device *rdev)
        radeon_get_clock_info(rdev->ddev);
 
        /* Fence driver */
-       r = radeon_fence_driver_init(rdev);
-       if (r)
-               return r;
+       radeon_fence_driver_init(rdev);
 
        /* initialize memory controller */
        r = si_mc_init(rdev);