aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-10-08 12:22:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-10-10 15:49:41 -0400
commit14b284832e7dea6f54f0adfd7bed105548b94e57 (patch)
tree564ad6847d5b2dd8f7b566f993691d2efe310073
parent582f58de36834096a91cc1de2540c2f7269f850d (diff)
drm/amdgpu/powerplay: fix missing break in switch statements
There are several switch statements that are missing break statements. Add missing breaks to handle any fall-throughs corner cases. Detected by CoverityScan, CID#1457175 ("Missing break in switch") Fixes: 18aafc59b106 ("drm/amd/powerplay: implement fw related smu interface for iceland.") Acked-by: Huang Rui <ray.huang@amd.com> Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c2
5 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
index 18643e06bc6f..669bd0c2a16c 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
@@ -2269,11 +2269,13 @@ static uint32_t ci_get_offsetof(uint32_t type, uint32_t member)
2269 case DRAM_LOG_BUFF_SIZE: 2269 case DRAM_LOG_BUFF_SIZE:
2270 return offsetof(SMU7_SoftRegisters, DRAM_LOG_BUFF_SIZE); 2270 return offsetof(SMU7_SoftRegisters, DRAM_LOG_BUFF_SIZE);
2271 } 2271 }
2272 break;
2272 case SMU_Discrete_DpmTable: 2273 case SMU_Discrete_DpmTable:
2273 switch (member) { 2274 switch (member) {
2274 case LowSclkInterruptThreshold: 2275 case LowSclkInterruptThreshold:
2275 return offsetof(SMU7_Discrete_DpmTable, LowSclkInterruptT); 2276 return offsetof(SMU7_Discrete_DpmTable, LowSclkInterruptT);
2276 } 2277 }
2278 break;
2277 } 2279 }
2278 pr_debug("can't get the offset of type %x member %x\n", type, member); 2280 pr_debug("can't get the offset of type %x member %x\n", type, member);
2279 return 0; 2281 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
index b6b62a79c8bb..bc8375cbf297 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
@@ -2321,6 +2321,7 @@ static uint32_t fiji_get_offsetof(uint32_t type, uint32_t member)
2321 case DRAM_LOG_BUFF_SIZE: 2321 case DRAM_LOG_BUFF_SIZE:
2322 return offsetof(SMU73_SoftRegisters, DRAM_LOG_BUFF_SIZE); 2322 return offsetof(SMU73_SoftRegisters, DRAM_LOG_BUFF_SIZE);
2323 } 2323 }
2324 break;
2324 case SMU_Discrete_DpmTable: 2325 case SMU_Discrete_DpmTable:
2325 switch (member) { 2326 switch (member) {
2326 case UvdBootLevel: 2327 case UvdBootLevel:
@@ -2330,6 +2331,7 @@ static uint32_t fiji_get_offsetof(uint32_t type, uint32_t member)
2330 case LowSclkInterruptThreshold: 2331 case LowSclkInterruptThreshold:
2331 return offsetof(SMU73_Discrete_DpmTable, LowSclkInterruptThreshold); 2332 return offsetof(SMU73_Discrete_DpmTable, LowSclkInterruptThreshold);
2332 } 2333 }
2334 break;
2333 } 2335 }
2334 pr_warn("can't get the offset of type %x member %x\n", type, member); 2336 pr_warn("can't get the offset of type %x member %x\n", type, member);
2335 return 0; 2337 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
index 374aa4a5f537..375ccf6ff5f2 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
@@ -2236,11 +2236,13 @@ static uint32_t iceland_get_offsetof(uint32_t type, uint32_t member)
2236 case DRAM_LOG_BUFF_SIZE: 2236 case DRAM_LOG_BUFF_SIZE:
2237 return offsetof(SMU71_SoftRegisters, DRAM_LOG_BUFF_SIZE); 2237 return offsetof(SMU71_SoftRegisters, DRAM_LOG_BUFF_SIZE);
2238 } 2238 }
2239 break;
2239 case SMU_Discrete_DpmTable: 2240 case SMU_Discrete_DpmTable:
2240 switch (member) { 2241 switch (member) {
2241 case LowSclkInterruptThreshold: 2242 case LowSclkInterruptThreshold:
2242 return offsetof(SMU71_Discrete_DpmTable, LowSclkInterruptThreshold); 2243 return offsetof(SMU71_Discrete_DpmTable, LowSclkInterruptThreshold);
2243 } 2244 }
2245 break;
2244 } 2246 }
2245 pr_warn("can't get the offset of type %x member %x\n", type, member); 2247 pr_warn("can't get the offset of type %x member %x\n", type, member);
2246 return 0; 2248 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
index 1f366c04c7ef..3ed6c5f1e5cf 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
@@ -2628,6 +2628,7 @@ static uint32_t tonga_get_offsetof(uint32_t type, uint32_t member)
2628 case DRAM_LOG_BUFF_SIZE: 2628 case DRAM_LOG_BUFF_SIZE:
2629 return offsetof(SMU72_SoftRegisters, DRAM_LOG_BUFF_SIZE); 2629 return offsetof(SMU72_SoftRegisters, DRAM_LOG_BUFF_SIZE);
2630 } 2630 }
2631 break;
2631 case SMU_Discrete_DpmTable: 2632 case SMU_Discrete_DpmTable:
2632 switch (member) { 2633 switch (member) {
2633 case UvdBootLevel: 2634 case UvdBootLevel:
@@ -2637,6 +2638,7 @@ static uint32_t tonga_get_offsetof(uint32_t type, uint32_t member)
2637 case LowSclkInterruptThreshold: 2638 case LowSclkInterruptThreshold:
2638 return offsetof(SMU72_Discrete_DpmTable, LowSclkInterruptThreshold); 2639 return offsetof(SMU72_Discrete_DpmTable, LowSclkInterruptThreshold);
2639 } 2640 }
2641 break;
2640 } 2642 }
2641 pr_warn("can't get the offset of type %x member %x\n", type, member); 2643 pr_warn("can't get the offset of type %x member %x\n", type, member);
2642 return 0; 2644 return 0;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
index 3d415fabbd93..9f71512b2510 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
@@ -2185,6 +2185,7 @@ static uint32_t vegam_get_offsetof(uint32_t type, uint32_t member)
2185 case DRAM_LOG_BUFF_SIZE: 2185 case DRAM_LOG_BUFF_SIZE:
2186 return offsetof(SMU75_SoftRegisters, DRAM_LOG_BUFF_SIZE); 2186 return offsetof(SMU75_SoftRegisters, DRAM_LOG_BUFF_SIZE);
2187 } 2187 }
2188 break;
2188 case SMU_Discrete_DpmTable: 2189 case SMU_Discrete_DpmTable:
2189 switch (member) { 2190 switch (member) {
2190 case UvdBootLevel: 2191 case UvdBootLevel:
@@ -2194,6 +2195,7 @@ static uint32_t vegam_get_offsetof(uint32_t type, uint32_t member)
2194 case LowSclkInterruptThreshold: 2195 case LowSclkInterruptThreshold:
2195 return offsetof(SMU75_Discrete_DpmTable, LowSclkInterruptThreshold); 2196 return offsetof(SMU75_Discrete_DpmTable, LowSclkInterruptThreshold);
2196 } 2197 }
2198 break;
2197 } 2199 }
2198 pr_warn("can't get the offset of type %x member %x\n", type, member); 2200 pr_warn("can't get the offset of type %x member %x\n", type, member);
2199 return 0; 2201 return 0;