Skip to contentSkip to conversation

drm/amdgpu: remove dead code in atom_get_src_int

PATCH In review Jesse Zhang 2 participants 2 messages Jun 3, 2024 – Jun 5, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/12 drm/amdgpu: remove dead code in atom_get_src_int

Since the range of align is 0~7, the expression is: align = (attr >> 3) & 7. In the case of ATOM_ARG_IMM, the code cannot reach the default case. So there is no need for "break".

---
 drivers/gpu/drm/amd/amdgpu/atom.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/atom.c +0 -1
index d552e013354c..c660e4a663ef 100644
@@ -320,7 +320,6 @@ static uint32_t atom_get_src_int(atom_exec_context *ctx, uint8_t attr,
 				DEBUG("IMM 0x%02X\n", val);
 			return val;
 		}
-		break;
 	case ATOM_ARG_PLL:
 		idx = U8(*ptr);
 		(*ptr)++;
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Jesse,

Quoted 25 lines

-----Original Message-----
From: Jesse Zhang <[email protected]>
Sent: Monday, June 3, 2024 4:47 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Kuehling, Felix <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH 04/12] drm/amdgpu: remove dead code in atom_get_src_int

Since the range of align is 0~7, the expression is: align = (attr >> 3) & 7. In the case of ATOM_ARG_IMM, the code cannot reach the default case. So there is no need for "break".

---
 drivers/gpu/drm/amd/amdgpu/atom.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/atom.c +0 -0
index d552e013354c..c660e4a663ef 100644

drivers/gpu/drm/amd/amdgpu/atom.c static uint32_t atom_get_src_int(atom_exec_context · line 324

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/atom.c +0 -1
@@ -320,7 +320,6 @@ static uint32_t atom_get_src_int(atom_exec_context
 *ctx, uint8_t attr,
                              DEBUG("IMM 0x%02X\n", val);
                      return val;
              }
-             break;

This should have new statement may fall through warning if remove the break here?

Tim Huang

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/atom.c +0 -0
      case ATOM_ARG_PLL:
              idx = U8(*ptr);
              (*ptr)++;

--
2.25.1