kernel/linux: reduce unneeded indents in meson file

Since meson 0.46, meson has supported the subdir_done() function, which
allows us to abort processing of a file early. Using this we can reduce the
indentation in our files by eliminating unnecessary else blocks.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
This commit is contained in:
Bruce Richardson 2019-05-17 14:45:28 +01:00 committed by Thomas Monjalon
parent 36681a5606
commit 41dec89f54

View File

@ -9,25 +9,25 @@ WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers
# if we are cross-compiling we need kernel_dir specified
if get_option('kernel_dir') == '' and meson.is_cross_build()
warning(WARN_CROSS_COMPILE)
else
subdir_done()
endif
kernel_dir = get_option('kernel_dir')
if kernel_dir == ''
# use default path for native builds
kernel_version = run_command('uname', '-r').stdout().strip()
kernel_dir = '/lib/modules/' + kernel_version + '/build'
endif
kernel_dir = get_option('kernel_dir')
if kernel_dir == ''
# use default path for native builds
kernel_version = run_command('uname', '-r').stdout().strip()
kernel_dir = '/lib/modules/' + kernel_version + '/build'
endif
# test running make in kernel directory, using "make kernelversion"
make_returncode = run_command('make', '-sC', kernel_dir,
'kernelversion').returncode()
if make_returncode != 0
warning(WARN_NO_HEADERS)
else # returncode == 0
# test running make in kernel directory, using "make kernelversion"
make_returncode = run_command('make', '-sC', kernel_dir,
'kernelversion').returncode()
if make_returncode != 0
warning(WARN_NO_HEADERS)
subdir_done()
endif
# DO ACTUAL MODULE BUILDING
foreach d:subdirs
subdir(d)
endforeach
endif
endif
foreach d:subdirs
subdir(d)
endforeach