diff mbox

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

Message ID 20180716134458.8654-1-colin.king@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Colin King July 16, 2018, 1:44 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/video/fbdev/tridentfb.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Bartlomiej Zolnierkiewicz July 24, 2018, 4:50 p.m. UTC | #1
On Monday, July 16, 2018 02:44:58 PM Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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")
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch queued for 4.19, thanks.

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

Patch

diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c
index 284706184b1b..f4b745590600 100644
--- a/drivers/video/fbdev/tridentfb.c
+++ b/drivers/video/fbdev/tridentfb.c
@@ -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;