Skip to content

Commit

Permalink
OMAPFB: remove compiler warnings when CONFIG_BUG=n
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed May 22, 2012
1 parent c6eee96 commit 4a75cb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/video/omap2/omapfb/omapfb-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions drivers/video/omap2/omapfb/omapfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4a75cb8

Please sign in to comment.