Skip to contentSkip to conversation

drm/amd/pm: Fix the return value in default case

PATCH In review Ma Jun 2 participants 2 messages Oct 19, 2023

Subsystems (3)
lore
Share & tools
lore

Ma Jun

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Fix the return value in default case

Fix the return value in default case and drop
redundant 'break'.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -3
index 7087f9840ab7..3b4053e2607b 100644
@@ -2434,7 +2434,6 @@ int smu_get_power_limit(void *handle,
 		break;
 	default:
 		return -EOPNOTSUPP;
-		break;
 	}
 
 	switch (pp_limit_level) {
@@ -2452,7 +2451,6 @@ int smu_get_power_limit(void *handle,
 		break;
 	default:
 		return -EOPNOTSUPP;
-		break;
 	}
 
 	if (limit_type != SMU_DEFAULT_PPT_LIMIT) {
@@ -2486,7 +2484,7 @@ int smu_get_power_limit(void *handle,
 			*limit = smu->min_power_limit;
 			break;
 		default:
-			break;
+			return -EINVAL;
 		}
 	}
 
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: Ma, Jun <[email protected]>
Sent: Thursday, October 19, 2023 10:29 AM
To: [email protected]; Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>
Cc: Ma, Jun <[email protected]>; Ma, Jun <[email protected]>
Subject: [PATCH] drm/amd/pm: Fix the return value in default case

Fix the return value in default case and drop redundant 'break'.

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -2
index 7087f9840ab7..3b4053e2607b 100644
@@ -2434,7 +2434,6 @@ int smu_get_power_limit(void *handle,
                break;
        default:
                return -EOPNOTSUPP;
-               break;
        }
 
        switch (pp_limit_level) {
@@ -2452,7 +2451,6 @@ int smu_get_power_limit(void *handle,
                break;
        default:
                return -EOPNOTSUPP;
-               break;
        }
 
        if (limit_type != SMU_DEFAULT_PPT_LIMIT) { @@ -2486,7 +2484,7 @@ int smu_get_power_limit(void *handle,
                        *limit = smu->min_power_limit;
                        break;
                default:
-                       break;
+                       return -EINVAL;
                }
        }

--
2.34.1