From: Bruce Richardson Date: Fri, 17 May 2019 13:45:28 +0000 (+0100) Subject: kernel/linux: reduce unneeded indents in meson file X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=41dec89f5450ce4ad37982c9a1cf121a2dd18829;p=dpdk.git 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 Reviewed-by: David Marchand Acked-by: Luca Boccassi --- diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index bf8f085b02..d31fc8f809 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -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