Skip to content

Commit

Permalink
OMAPDSS: VRFB: 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 <[email protected]>
  • Loading branch information
tomba committed May 22, 2012
1 parent 4a75cb8 commit 3cb6a1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/video/omap2/vrfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3cb6a1b

Please sign in to comment.