From: Tomi Valkeinen Date: Fri, 18 May 2012 08:49:53 +0000 (+0300) Subject: OMAPDSS: VRFB: remove compiler warnings when CONFIG_BUG=n X-Git-Tag: v3.5-rc1~7^2~5^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3cb6a1b9672a2e0937a1475e3d68e6c236133156;p=karo-tx-linux.git OMAPDSS: VRFB: 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 --- diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c index 4e5b960c32c8..7e990220ad2a 100644 --- a/drivers/video/omap2/vrfb.c +++ b/drivers/video/omap2/vrfb.c @@ -179,8 +179,10 @@ void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, pixel_size_exp = 2; else if (bytespp == 2) pixel_size_exp = 1; - else + else { BUG(); + return; + } vrfb_width = ALIGN(width * bytespp, VRFB_PAGE_WIDTH) / bytespp; vrfb_height = ALIGN(height, VRFB_PAGE_HEIGHT);