aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-18 04:47:02 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-22 03:59:14 -0400
commitc6eee968d40d319f0ac7a8a63dcbc633d9e6a2ea (patch)
tree69c37f169f25f8fad858b032508d2a1c2cd5c8ea
parent36377357db00f8660039578ba57a2a19bfc9ad3d (diff)
OMAPDSS: remove compiler warnings when CONFIG_BUG=n
If CONFIG_BUG is not enabled, BUG() does not stop the execution. Many places in code expect the execution to stop, and this causes compiler warnings about uninitialized variables and returning from a non-void function without a return value. This patch fixes the warnings by initializing the variables and returning properly after BUG() lines. However, the behaviour is still undefined after the BUG, but this is the choice the user makes when using CONFIG_BUG=n. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dispc.c31
-rw-r--r--drivers/video/omap2/dss/dispc.h72
-rw-r--r--drivers/video/omap2/dss/display.c2
-rw-r--r--drivers/video/omap2/dss/dsi.c9
-rw-r--r--drivers/video/omap2/dss/dss.c3
-rw-r--r--drivers/video/omap2/dss/venc.c1
6 files changed, 113 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 0fa1c94e8c58..3d0576d1983c 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -407,6 +407,7 @@ u32 dispc_mgr_get_vsync_irq(enum omap_channel channel)
407 return DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN; 407 return DISPC_IRQ_EVSYNC_ODD | DISPC_IRQ_EVSYNC_EVEN;
408 default: 408 default:
409 BUG(); 409 BUG();
410 return 0;
410 } 411 }
411} 412}
412 413
@@ -421,6 +422,7 @@ u32 dispc_mgr_get_framedone_irq(enum omap_channel channel)
421 return 0; 422 return 0;
422 default: 423 default:
423 BUG(); 424 BUG();
425 return 0;
424 } 426 }
425} 427}
426 428
@@ -739,7 +741,7 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane,
739 case OMAP_DSS_COLOR_XRGB16_1555: 741 case OMAP_DSS_COLOR_XRGB16_1555:
740 m = 0xf; break; 742 m = 0xf; break;
741 default: 743 default:
742 BUG(); break; 744 BUG(); return;
743 } 745 }
744 } else { 746 } else {
745 switch (color_mode) { 747 switch (color_mode) {
@@ -776,7 +778,7 @@ static void dispc_ovl_set_color_mode(enum omap_plane plane,
776 case OMAP_DSS_COLOR_XRGB16_1555: 778 case OMAP_DSS_COLOR_XRGB16_1555:
777 m = 0xf; break; 779 m = 0xf; break;
778 default: 780 default:
779 BUG(); break; 781 BUG(); return;
780 } 782 }
781 } 783 }
782 784
@@ -820,6 +822,7 @@ void dispc_ovl_set_channel_out(enum omap_plane plane, enum omap_channel channel)
820 break; 822 break;
821 default: 823 default:
822 BUG(); 824 BUG();
825 return;
823 } 826 }
824 827
825 val = FLD_MOD(val, chan, shift, shift); 828 val = FLD_MOD(val, chan, shift, shift);
@@ -847,6 +850,7 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
847 break; 850 break;
848 default: 851 default:
849 BUG(); 852 BUG();
853 return 0;
850 } 854 }
851 855
852 val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); 856 val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane));
@@ -1209,6 +1213,7 @@ static void dispc_ovl_set_accu_uv(enum omap_plane plane,
1209 break; 1213 break;
1210 default: 1214 default:
1211 BUG(); 1215 BUG();
1216 return;
1212 } 1217 }
1213 1218
1214 switch (color_mode) { 1219 switch (color_mode) {
@@ -1224,6 +1229,7 @@ static void dispc_ovl_set_accu_uv(enum omap_plane plane,
1224 break; 1229 break;
1225 default: 1230 default:
1226 BUG(); 1231 BUG();
1232 return;
1227 } 1233 }
1228 1234
1229 accu_val = &accu_table[idx]; 1235 accu_val = &accu_table[idx];
@@ -1339,6 +1345,7 @@ static void dispc_ovl_set_scaling_uv(enum omap_plane plane,
1339 break; 1345 break;
1340 default: 1346 default:
1341 BUG(); 1347 BUG();
1348 return;
1342 } 1349 }
1343 1350
1344 if (out_width != orig_width) 1351 if (out_width != orig_width)
@@ -1466,6 +1473,7 @@ static int color_mode_to_bpp(enum omap_color_mode color_mode)
1466 return 32; 1473 return 32;
1467 default: 1474 default:
1468 BUG(); 1475 BUG();
1476 return 0;
1469 } 1477 }
1470} 1478}
1471 1479
@@ -1479,6 +1487,7 @@ static s32 pixinc(int pixels, u8 ps)
1479 return 1 - (-pixels + 1) * ps; 1487 return 1 - (-pixels + 1) * ps;
1480 else 1488 else
1481 BUG(); 1489 BUG();
1490 return 0;
1482} 1491}
1483 1492
1484static void calc_vrfb_rotation_offset(u8 rotation, bool mirror, 1493static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
@@ -1562,6 +1571,7 @@ static void calc_vrfb_rotation_offset(u8 rotation, bool mirror,
1562 1571
1563 default: 1572 default:
1564 BUG(); 1573 BUG();
1574 return;
1565 } 1575 }
1566} 1576}
1567 1577
@@ -1717,6 +1727,7 @@ static void calc_dma_rotation_offset(u8 rotation, bool mirror,
1717 1727
1718 default: 1728 default:
1719 BUG(); 1729 BUG();
1730 return;
1720 } 1731 }
1721} 1732}
1722 1733
@@ -2106,6 +2117,11 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
2106 if (fieldmode) 2117 if (fieldmode)
2107 field_offset = 1; 2118 field_offset = 1;
2108 2119
2120 offset0 = 0;
2121 offset1 = 0;
2122 row_inc = 0;
2123 pix_inc = 0;
2124
2109 if (oi->rotation_type == OMAP_DSS_ROT_DMA) 2125 if (oi->rotation_type == OMAP_DSS_ROT_DMA)
2110 calc_dma_rotation_offset(oi->rotation, oi->mirror, 2126 calc_dma_rotation_offset(oi->rotation, oi->mirror,
2111 oi->screen_width, in_width, frame_height, 2127 oi->screen_width, in_width, frame_height,
@@ -2316,8 +2332,10 @@ bool dispc_mgr_is_enabled(enum omap_channel channel)
2316 return !!REG_GET(DISPC_CONTROL, 1, 1); 2332 return !!REG_GET(DISPC_CONTROL, 1, 1);
2317 else if (channel == OMAP_DSS_CHANNEL_LCD2) 2333 else if (channel == OMAP_DSS_CHANNEL_LCD2)
2318 return !!REG_GET(DISPC_CONTROL2, 0, 0); 2334 return !!REG_GET(DISPC_CONTROL2, 0, 0);
2319 else 2335 else {
2320 BUG(); 2336 BUG();
2337 return false;
2338 }
2321} 2339}
2322 2340
2323void dispc_mgr_enable(enum omap_channel channel, bool enable) 2341void dispc_mgr_enable(enum omap_channel channel, bool enable)
@@ -2593,8 +2611,10 @@ void dispc_mgr_set_timings(enum omap_channel channel,
2593 DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res, 2611 DSSDBG("channel %d xres %u yres %u\n", channel, timings->x_res,
2594 timings->y_res); 2612 timings->y_res);
2595 2613
2596 if (!dispc_mgr_timings_ok(channel, timings)) 2614 if (!dispc_mgr_timings_ok(channel, timings)) {
2597 BUG(); 2615 BUG();
2616 return;
2617 }
2598 2618
2599 if (dispc_mgr_is_lcd(channel)) { 2619 if (dispc_mgr_is_lcd(channel)) {
2600 _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp, 2620 _dispc_mgr_set_lcd_timings(channel, timings->hsw, timings->hfp,
@@ -2658,6 +2678,7 @@ unsigned long dispc_fclk_rate(void)
2658 break; 2678 break;
2659 default: 2679 default:
2660 BUG(); 2680 BUG();
2681 return 0;
2661 } 2682 }
2662 2683
2663 return r; 2684 return r;
@@ -2688,6 +2709,7 @@ unsigned long dispc_mgr_lclk_rate(enum omap_channel channel)
2688 break; 2709 break;
2689 default: 2710 default:
2690 BUG();