Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss

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>

authored by

Behan Webster and committed by
Tomi Valkeinen
032e57f0 8251434b

+14 -11
+5 -4
drivers/video/fbdev/omap2/dss/dispc-compat.c
··· 634 634 WARN_ON(1); 635 635 } 636 636 637 + static inline void dispc_irq_wait_handler(void *data, u32 mask) 638 + { 639 + complete((struct completion *)data); 640 + } 641 + 637 642 int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, 638 643 unsigned long timeout) 639 644 { 640 - void dispc_irq_wait_handler(void *data, u32 mask) 641 - { 642 - complete((struct completion *)data); 643 - } 644 645 645 646 int r; 646 647 DECLARE_COMPLETION_ONSTACK(completion);
+9 -7
drivers/video/fbdev/omap2/dss/manager-sysfs.c
··· 44 44 dssdev->name : "<none>"); 45 45 } 46 46 47 + static int manager_display_match(struct omap_dss_device *dssdev, void *data) 48 + { 49 + const char *str = data; 50 + 51 + return sysfs_streq(dssdev->name, str); 52 + } 53 + 47 54 static ssize_t manager_display_store(struct omap_overlay_manager *mgr, 48 55 const char *buf, size_t size) 49 56 { ··· 59 52 struct omap_dss_device *dssdev = NULL; 60 53 struct omap_dss_device *old_dssdev; 61 54 62 - int match(struct omap_dss_device *dssdev, void *data) 63 - { 64 - const char *str = data; 65 - return sysfs_streq(dssdev->name, str); 66 - } 67 - 68 55 if (buf[size-1] == '\n') 69 56 --len; 70 57 71 58 if (len > 0) 72 - dssdev = omap_dss_find_device((void *)buf, match); 59 + dssdev = omap_dss_find_device((void *)buf, 60 + manager_display_match); 73 61 74 62 if (len > 0 && dssdev == NULL) 75 63 return -EINVAL;