]> git.karo-electronics.de Git - linux-beck.git/commitdiff
arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
authorBehan Webster <behanw@converseincode.com>
Sat, 27 Sep 2014 01:10:52 +0000 (18:10 -0700)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 30 Sep 2014 10:11:44 +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/dss/dispc-compat.c
drivers/video/fbdev/omap2/dss/manager-sysfs.c

index 83779c2b292ad466311a235402a4c7564f9f0a14..633c461fbc6eb52323f124faa7846393c175641d 100644 (file)
@@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel)
                WARN_ON(1);
 }
 
+static inline void dispc_irq_wait_handler(void *data, u32 mask)
+{
+       complete((struct completion *)data);
+}
+
 int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
                unsigned long timeout)
 {
-       void dispc_irq_wait_handler(void *data, u32 mask)
-       {
-               complete((struct completion *)data);
-       }
 
        int r;
        DECLARE_COMPLETION_ONSTACK(completion);
index 37b59fe28dc8ad77dc49daa2fa63127b3fc7450f..a7414fb12830260df190985a438161ef3c0e5b20 100644 (file)
@@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf)
                        dssdev->name : "<none>");
 }
 
+static int manager_display_match(struct omap_dss_device *dssdev, void *data)
+{
+       const char *str = data;
+
+       return sysfs_streq(dssdev->name, str);
+}
+
 static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
                const char *buf, size_t size)
 {
@@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr,
        struct omap_dss_device *dssdev = NULL;
        struct omap_dss_device *old_dssdev;
 
-       int match(struct omap_dss_device *dssdev, void *data)
-       {
-               const char *str = data;
-               return sysfs_streq(dssdev->name, str);
-       }
-
        if (buf[size-1] == '\n')
                --len;
 
        if (len > 0)
-               dssdev = omap_dss_find_device((void *)buf, match);
+               dssdev = omap_dss_find_device((void *)buf,
+                       manager_display_match);
 
        if (len > 0 && dssdev == NULL)
                return -EINVAL;