]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb
authorBehan Webster <behanw@converseincode.com>
Sat, 27 Sep 2014 01:10:53 +0000 (18:10 -0700)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 30 Sep 2014 10:11:53 +0000 (13:11 +0300)
Replace the use of nested functions where a normal function will suffice.

Nested functions are not liked by upstream kernel developers in general. Their
use breaks the use of clang as a compiler, and doesn't make the code any
better.

This code now works for both gcc and clang.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/omap2/omapfb/omapfb-main.c

index ec2d132c782d20b2ffa0d08e842131b56511cbda..15872433e0c6a9ae00a209efe181dc3a1bea3a8c 100644 (file)
@@ -273,16 +273,16 @@ static struct omapfb_colormode omapfb_colormodes[] = {
        },
 };
 
+static bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2)
+{
+       return f1->length == f2->length &&
+               f1->offset == f2->offset &&
+               f1->msb_right == f2->msb_right;
+}
+
 static bool cmp_var_to_colormode(struct fb_var_screeninfo *var,
                struct omapfb_colormode *color)
 {
-       bool cmp_component(struct fb_bitfield *f1, struct fb_bitfield *f2)
-       {
-               return f1->length == f2->length &&
-                       f1->offset == f2->offset &&
-                       f1->msb_right == f2->msb_right;
-       }
-
        if (var->bits_per_pixel == 0 ||
                        var->red.length == 0 ||
                        var->blue.length == 0 ||