DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 19.08 2/3] kernel/linux: reduce unneeded indents in meson build file
Date: Tue, 30 Apr 2019 15:03:24 +0100	[thread overview]
Message-ID: <20190430140325.45537-3-bruce.richardson@intel.com> (raw)
Message-ID: <20190430140324.5EI4W5vD2jXA82PU9cHRpmvZ0zlF3saDn0fz82noJZo@z> (raw)
In-Reply-To: <20190430140325.45537-1-bruce.richardson@intel.com>

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>
---
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
-- 
2.20.1


  parent reply	other threads:[~2019-04-30 14:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 14:03 [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux Bruce Richardson
2019-04-30 14:03 ` Bruce Richardson
2019-04-30 14:03 ` [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check Bruce Richardson
2019-04-30 14:03   ` Bruce Richardson
2019-04-30 14:13   ` Bruce Richardson
2019-04-30 14:13     ` Bruce Richardson
2019-04-30 14:03 ` Bruce Richardson [this message]
2019-04-30 14:03   ` [dpdk-dev] [PATCH 19.08 2/3] kernel/linux: reduce unneeded indents in meson build file Bruce Richardson
2019-04-30 14:03 ` [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables Bruce Richardson
2019-04-30 14:03   ` Bruce Richardson
2019-04-30 14:17 ` [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux David Marchand
2019-04-30 14:17   ` David Marchand
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
2019-05-17 13:45   ` [dpdk-dev] [PATCH v2 1/3] kernel/linux: remove unnecessary meson version check Bruce Richardson
2019-05-17 13:45   ` [dpdk-dev] [PATCH v2 2/3] kernel/linux: reduce unneeded indents in meson build file Bruce Richardson
2019-05-17 13:45   ` [dpdk-dev] [PATCH v2 3/3] kernel/linux: remove unneeded local variables Bruce Richardson
2019-05-17 13:53   ` [dpdk-dev] [PATCH v2 0/3] cleanup kernel meson.build file for linux Luca Boccassi
2019-05-29 22:27     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190430140325.45537-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).