Skip to contentSkip to conversation

video: fbdev: tridentfb: remove deadcode on unreachable case statement

PATCH In review Colin King 2 participants 2 messages Jul 16, 2018 – Jul 24, 2018

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 video: fbdev: tridentfb: remove deadcode on unreachable case statement

From: Colin Ian King <[email protected]>

The value of tmp being used in the switch statement has the range of just 0..3 hence the case 4 statement can never be reached and is deadcode and can be removed.

Detected by CoverityScan, CID#744384 ("Logically dead code")

---
 drivers/video/fbdev/tridentfb.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/video/fbdev/tridentfb.c +0 -3
index 284706184b1b..f4b745590600 100644
@@ -777,9 +777,6 @@ static int get_nativex(struct tridentfb_par *par)
 	case 3:
 		x = 800; y = 600;
 		break;
-	case 4:
-		x = 1400; y = 1050;
-		break;
 	case 1:
 	default:
 		x = 640;  y = 480;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The value of tmp being used in the switch statement has the range of just 0..3 hence the case 4 statement can never be reached and is deadcode and can be removed.

Detected by CoverityScan, CID#744384 ("Logically dead code")

Patch queued for 4.19, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics