* [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux
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
` (4 subsequent siblings)
5 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
Small cleanups to shorten the meson.build file in the kernel/linux
directory, removing the unneeded version check and taking advantage of the
subdir_done() function introduced in meson 0.46.
These should be fairly harmless, but given the stage of development we
are at for 19.05, targetting them to 19.08 instead. [They can be pulled
in to 19.05 if so desired, though. :-)]
Bruce Richardson (3):
kernel/linux: remove unnecessary meson version check
kernel/linux: reduce unneeded indents in meson build file
kernel/linux: remove unneeded local variables
kernel/linux/meson.build | 46 +++++++++++++++++-----------------------
1 file changed, 19 insertions(+), 27 deletions(-)
--
2.20.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check
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 ` Bruce Richardson
2019-04-30 14:03 ` Bruce Richardson
2019-04-30 14:13 ` Bruce Richardson
2019-04-30 14:03 ` [dpdk-dev] [PATCH 19.08 2/3] kernel/linux: reduce unneeded indents in meson build file Bruce Richardson
` (3 subsequent siblings)
5 siblings, 2 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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 <bruce.richardson@intel.com>
---
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')
--
2.20.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check
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
1 sibling, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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 <bruce.richardson@intel.com>
---
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')
--
2.20.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check
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
1 sibling, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:13 UTC (permalink / raw)
To: dev
On Tue, Apr 30, 2019 at 03:03:23PM +0100, Bruce Richardson wrote:
> The check for meson version 0.44 is not redundant since the minimum
"not", in this case, being used as a synonym for "now" :-)
> supported version for the project as a whole is 0.47.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> 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')
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH 19.08 1/3] kernel/linux: remove unnecessary meson version check
2019-04-30 14:13 ` Bruce Richardson
@ 2019-04-30 14:13 ` Bruce Richardson
0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:13 UTC (permalink / raw)
To: dev
On Tue, Apr 30, 2019 at 03:03:23PM +0100, Bruce Richardson wrote:
> The check for meson version 0.44 is not redundant since the minimum
"not", in this case, being used as a synonym for "now" :-)
> supported version for the project as a whole is 0.47.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> 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')
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 2/3] kernel/linux: reduce unneeded indents in meson build file
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:03 ` Bruce Richardson
2019-04-30 14:03 ` [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables Bruce Richardson
` (2 subsequent siblings)
5 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 2/3] kernel/linux: reduce unneeded indents in meson build file
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 ` Bruce Richardson
0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables
2019-04-30 14:03 [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux Bruce Richardson
` (2 preceding siblings ...)
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 ` 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-05-17 13:45 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
5 siblings, 1 reply; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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 <bruce.richardson@intel.com>
---
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
--
2.20.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables
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
0 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-04-30 14:03 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
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 <bruce.richardson@intel.com>
---
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
--
2.20.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux
2019-04-30 14:03 [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux Bruce Richardson
` (3 preceding siblings ...)
2019-04-30 14:03 ` [dpdk-dev] [PATCH 19.08 3/3] kernel/linux: remove unneeded local variables Bruce Richardson
@ 2019-04-30 14:17 ` David Marchand
2019-04-30 14:17 ` David Marchand
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
5 siblings, 1 reply; 18+ messages in thread
From: David Marchand @ 2019-04-30 14:17 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Tue, Apr 30, 2019 at 4:04 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:
> Small cleanups to shorten the meson.build file in the kernel/linux
> directory, removing the unneeded version check and taking advantage of the
> subdir_done() function introduced in meson 0.46.
>
> These should be fairly harmless, but given the stage of development we
> are at for 19.05, targetting them to 19.08 instead. [They can be pulled
> in to 19.05 if so desired, though. :-)]
>
> Bruce Richardson (3):
> kernel/linux: remove unnecessary meson version check
> kernel/linux: reduce unneeded indents in meson build file
> kernel/linux: remove unneeded local variables
>
> kernel/linux/meson.build | 46 +++++++++++++++++-----------------------
> 1 file changed, 19 insertions(+), 27 deletions(-)
>
> --
> 2.20.1
>
For the series,
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux
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
0 siblings, 0 replies; 18+ messages in thread
From: David Marchand @ 2019-04-30 14:17 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Tue, Apr 30, 2019 at 4:04 PM Bruce Richardson <bruce.richardson@intel.com>
wrote:
> Small cleanups to shorten the meson.build file in the kernel/linux
> directory, removing the unneeded version check and taking advantage of the
> subdir_done() function introduced in meson 0.46.
>
> These should be fairly harmless, but given the stage of development we
> are at for 19.05, targetting them to 19.08 instead. [They can be pulled
> in to 19.05 if so desired, though. :-)]
>
> Bruce Richardson (3):
> kernel/linux: remove unnecessary meson version check
> kernel/linux: reduce unneeded indents in meson build file
> kernel/linux: remove unneeded local variables
>
> kernel/linux/meson.build | 46 +++++++++++++++++-----------------------
> 1 file changed, 19 insertions(+), 27 deletions(-)
>
> --
> 2.20.1
>
For the series,
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH v2 0/3] cleanup kernel meson.build file for linux
2019-04-30 14:03 [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux Bruce Richardson
` (4 preceding siblings ...)
2019-04-30 14:17 ` [dpdk-dev] [PATCH 19.08 0/3] cleanup kernel meson.build file for linux David Marchand
@ 2019-05-17 13:45 ` Bruce Richardson
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 1/3] kernel/linux: remove unnecessary meson version check Bruce Richardson
` (3 more replies)
5 siblings, 4 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-05-17 13:45 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bluca, Bruce Richardson
Small cleanups to shorten the meson.build file in the kernel/linux
directory, removing the unneeded version check and taking advantage of the
subdir_done() function introduced in meson 0.46.
V2:
resubmit without the 19.08 patch prefix and with the typo
removed in patch 1.
Bruce Richardson (3):
kernel/linux: remove unnecessary meson version check
kernel/linux: reduce unneeded indents in meson build file
kernel/linux: remove unneeded local variables
kernel/linux/meson.build | 46 +++++++++++++++++-----------------------
1 file changed, 19 insertions(+), 27 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH v2 1/3] kernel/linux: remove unnecessary meson version check
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
@ 2019-05-17 13:45 ` Bruce Richardson
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 2/3] kernel/linux: reduce unneeded indents in meson build file Bruce Richardson
` (2 subsequent siblings)
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-05-17 13:45 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bluca, Bruce Richardson
The check for meson version 0.44 is redundant since the minimum
supported version for the project as a whole is 0.47.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
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')
--
2.21.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH v2 2/3] kernel/linux: reduce unneeded indents in meson build file
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 ` 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
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-05-17 13:45 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bluca, Bruce Richardson
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>
---
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [dpdk-dev] [PATCH v2 3/3] kernel/linux: remove unneeded local variables
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 ` Bruce Richardson
2019-05-17 13:53 ` [dpdk-dev] [PATCH v2 0/3] cleanup kernel meson.build file for linux Luca Boccassi
3 siblings, 0 replies; 18+ messages in thread
From: Bruce Richardson @ 2019-05-17 13:45 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bluca, Bruce Richardson
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 <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
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
--
2.21.0
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] cleanup kernel meson.build file for linux
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
` (2 preceding siblings ...)
2019-05-17 13:45 ` [dpdk-dev] [PATCH v2 3/3] kernel/linux: remove unneeded local variables Bruce Richardson
@ 2019-05-17 13:53 ` Luca Boccassi
2019-05-29 22:27 ` Thomas Monjalon
3 siblings, 1 reply; 18+ messages in thread
From: Luca Boccassi @ 2019-05-17 13:53 UTC (permalink / raw)
To: Bruce Richardson, dev; +Cc: david.marchand
On Fri, 2019-05-17 at 14:45 +0100, Bruce Richardson wrote:
> Small cleanups to shorten the meson.build file in the kernel/linux
> directory, removing the unneeded version check and taking advantage
> of the
> subdir_done() function introduced in meson 0.46.
>
> V2:
> resubmit without the 19.08 patch prefix and with the typo
> removed in patch 1.
>
> Bruce Richardson (3):
> kernel/linux: remove unnecessary meson version check
> kernel/linux: reduce unneeded indents in meson build file
> kernel/linux: remove unneeded local variables
>
> kernel/linux/meson.build | 46 +++++++++++++++++---------------------
> --
> 1 file changed, 19 insertions(+), 27 deletions(-)
Series-acked-by: Luca Boccassi <bluca@debian.org>
--
Kind regards,
Luca Boccassi
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/3] cleanup kernel meson.build file for linux
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
0 siblings, 0 replies; 18+ messages in thread
From: Thomas Monjalon @ 2019-05-29 22:27 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Luca Boccassi, david.marchand
17/05/2019 15:53, Luca Boccassi:
> On Fri, 2019-05-17 at 14:45 +0100, Bruce Richardson wrote:
> > Small cleanups to shorten the meson.build file in the kernel/linux
> > directory, removing the unneeded version check and taking advantage
> > of the
> > subdir_done() function introduced in meson 0.46.
> >
> > V2:
> > resubmit without the 19.08 patch prefix and with the typo
> > removed in patch 1.
> >
> > Bruce Richardson (3):
> > kernel/linux: remove unnecessary meson version check
> > kernel/linux: reduce unneeded indents in meson build file
> > kernel/linux: remove unneeded local variables
>
> Series-acked-by: Luca Boccassi <bluca@debian.org>
Applied, thanks
^ permalink raw reply [flat|nested] 18+ messages in thread