From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C0337A00E6 for ; Fri, 17 May 2019 15:45:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1A8597CB0; Fri, 17 May 2019 15:45:41 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id EBD0B6904 for ; Fri, 17 May 2019 15:45:39 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 May 2019 06:45:39 -0700 X-ExtLoop1: 1 Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga004.jf.intel.com with ESMTP; 17 May 2019 06:45:38 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: david.marchand@redhat.com, bluca@debian.org, Bruce Richardson Date: Fri, 17 May 2019 14:45:28 +0100 Message-Id: <20190517134529.18160-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190517134529.18160-1-bruce.richardson@intel.com> References: <20190430140325.45537-1-bruce.richardson@intel.com> <20190517134529.18160-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 2/3] kernel/linux: reduce unneeded indents in meson build file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- kernel/linux/meson.build | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index bf8f085b0..d31fc8f80 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 -- 2.21.0