]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
OMAPFB: remove compiler warnings when CONFIG_BUG=n
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 18 May 2012 08:48:28 +0000 (11:48 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 22 May 2012 07:59:15 +0000 (10:59 +0300)
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>
drivers/video/omap2/omapfb/omapfb-main.c
drivers/video/omap2/omapfb/omapfb.h

index 165a4be95025a2e2cdb72160f8b1884d037d8ac3..3450ea0966c97e6227145f3ad484f4850f0125ff 100644 (file)
@@ -179,6 +179,7 @@ static unsigned omapfb_get_vrfb_offset(const struct omapfb_info *ofbi, int rot)
                break;
        default:
                BUG();
+               return 0;
        }
 
        offset *= vrfb->bytespp;
index c0bdc9b54ecf77d1f22355ca956b6367d2ceac70..30361a09aecdd231c19d40241733d1aa873e1a79 100644 (file)
@@ -166,6 +166,7 @@ static inline struct omapfb_display_data *get_display_data(
 
        /* This should never happen */
        BUG();
+       return NULL;
 }
 
 static inline void omapfb_lock(struct omapfb2_device *fbdev)