From patchwork Tue Apr 30 14:03:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53165 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F8125F16; Tue, 30 Apr 2019 16:04:01 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id C1EBD5F0F for ; Tue, 30 Apr 2019 16:03:58 +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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 07:03:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,413,1549958400"; d="scan'208";a="295794110" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga004.jf.intel.com with ESMTP; 30 Apr 2019 07:03:37 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 30 Apr 2019 15:03:23 +0100 Message-Id: <20190430140325.45537-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190430140325.45537-1-bruce.richardson@intel.com> References: <20190430140325.45537-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check 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" The check for meson version 0.44 is not redundant since the minimum supported version for the project as a whole is 0.47. Signed-off-by: Bruce Richardson --- kernel/linux/meson.build | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index d751d939f..bf8f085b0 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -7,13 +7,8 @@ WARN_CROSS_COMPILE='Need "kernel_dir" option for kmod compilation when cross-com WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers installed?' # if we are cross-compiling we need kernel_dir specified -# NOTE: warning() function only available from version 0.44 onwards if get_option('kernel_dir') == '' and meson.is_cross_build() - if meson.version().version_compare('>=0.44') - warning(WARN_CROSS_COMPILE) - else - message('WARNING: ' + WARN_CROSS_COMPILE) - endif + warning(WARN_CROSS_COMPILE) else kernel_dir = get_option('kernel_dir') From patchwork Tue Apr 30 14:03:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53167 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 831F35F27; Tue, 30 Apr 2019 16:04:06 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AC3B15F14 for ; Tue, 30 Apr 2019 16:04:00 +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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 07:03:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,413,1549958400"; d="scan'208";a="295794131" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga004.jf.intel.com with ESMTP; 30 Apr 2019 07:03:41 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 30 Apr 2019 15:03:24 +0100 Message-Id: <20190430140325.45537-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190430140325.45537-1-bruce.richardson@intel.com> References: <20190430140325.45537-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 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 --- Note: though the diff here seems fairly big, a lot of it is whitespace change due to reduced indentation. Using "git diff -w" is recommended for easier review. --- 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 From patchwork Tue Apr 30 14:03:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 53166 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80FF85F1F; Tue, 30 Apr 2019 16:04:04 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 914265F0F for ; Tue, 30 Apr 2019 16:03:59 +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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 07:03:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,413,1549958400"; d="scan'208";a="295794145" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.222.236]) by orsmga004.jf.intel.com with ESMTP; 30 Apr 2019 07:03:43 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Date: Tue, 30 Apr 2019 15:03:25 +0100 Message-Id: <20190430140325.45537-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190430140325.45537-1-bruce.richardson@intel.com> References: <20190430140325.45537-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables 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" The local variables for the error message aren't needed, since the messages aren't used more than once, and the indent levels are now such that the lines printing the message are not much longer than the lines defining the variables to hold the messages themselves. Therefore the use of the variables is pointless. Signed-off-by: Bruce Richardson --- kernel/linux/meson.build | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/linux/meson.build b/kernel/linux/meson.build index d31fc8f80..a37c95752 100644 --- a/kernel/linux/meson.build +++ b/kernel/linux/meson.build @@ -3,12 +3,9 @@ subdirs = ['igb_uio', 'kni'] -WARN_CROSS_COMPILE='Need "kernel_dir" option for kmod compilation when cross-compiling' -WARN_NO_HEADERS='Cannot compile kernel modules as requested - are kernel headers installed?' - # if we are cross-compiling we need kernel_dir specified if get_option('kernel_dir') == '' and meson.is_cross_build() - warning(WARN_CROSS_COMPILE) + warning('Need "kernel_dir" option for kmod compilation when cross-compiling') subdir_done() endif @@ -23,7 +20,7 @@ endif make_returncode = run_command('make', '-sC', kernel_dir, 'kernelversion').returncode() if make_returncode != 0 - warning(WARN_NO_HEADERS) + warning('Cannot compile kernel modules as requested - are kernel headers installed?') subdir_done() endif