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.
The LLVMLinux project aims to fully build the Linux kernel using both gcc and
clang (the C front end for the LLVM compiler infrastructure project).
Behan Webster (2):
arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb
drivers/video/fbdev/omap2/dss/dispc-compat.c | 9 +++++----
drivers/video/fbdev/omap2/dss/manager-sysfs.c | 16 +++++++++-------
drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 14 +++++++-------
3 files changed, 21 insertions(+), 18 deletions(-)
--
1.9.1
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 <redacted>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
---
drivers/video/fbdev/omap2/dss/dispc-compat.c | 9 +++++----
drivers/video/fbdev/omap2/dss/manager-sysfs.c | 16 +++++++++-------
2 files changed, 14 insertions(+), 11 deletions(-)
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 <redacted>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
---
drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
From: Felipe Balbi <hidden> Date: 2014-09-27 16:46:47
On Fri, Sep 26, 2014 at 06:10:52PM -0700, Behan Webster wrote:
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 <redacted>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
another one that make sense :-) And probably also deserves
checkpatch/coccinelle/sparse.
Reviewed-by: Felipe Balbi <redacted>
--
balbi
From: Felipe Balbi <hidden> Date: 2014-09-27 16:47:10
On Fri, Sep 26, 2014 at 06:10:53PM -0700, Behan Webster wrote:
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 <redacted>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
On Fri, Sep 26, 2014 at 06:10:52PM -0700, Behan Webster wrote:
quoted
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 <redacted>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
another one that make sense :-) And probably also deserves
checkpatch/coccinelle/sparse.
Indeed! That would be very appreciated.
The clang static analyzer already points this one out. :)
Behan
--
Behan Webster
behanw@converseincode.com
From: Tomi Valkeinen <hidden> Date: 2014-09-30 10:15:52
On 27/09/14 04:10, Behan Webster wrote:
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.
The LLVMLinux project aims to fully build the Linux kernel using both gcc and
clang (the C front end for the LLVM compiler infrastructure project).
Behan Webster (2):
arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb
drivers/video/fbdev/omap2/dss/dispc-compat.c | 9 +++++----
drivers/video/fbdev/omap2/dss/manager-sysfs.c | 16 +++++++++-------
drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 14 +++++++-------
3 files changed, 21 insertions(+), 18 deletions(-)
I have to say I do like small helper funcs as nested functions, as they
are restricted inside the parent function's scope. But, of course,
nested funcs have their issues.
So looks fine to me, queuing for 3.18.
Tomi