diff mbox series

[v8,03/14] build: remove unused or superfluous variables

Message ID 1604649795-27476-4-git-send-email-juraj.linkes@pantheon.tech (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series Arm build options rework | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš Nov. 6, 2020, 8:03 a.m. UTC
Remove variables that were either not used, referenced just once or not
needed.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 config/arm/meson.build | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

Comments

Honnappa Nagarahalli Nov. 7, 2020, 12:52 a.m. UTC | #1
<snip>

> 
> Remove variables that were either not used, referenced just once or not
> needed.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  config/arm/meson.build | 28 +++++++---------------------
>  1 file changed, 7 insertions(+), 21 deletions(-)
> 
> diff --git a/config/arm/meson.build b/config/arm/meson.build index
> 7fe0f3f3c..7c7059cc2 100644
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> @@ -3,11 +3,7 @@
>  # Copyright(c) 2017 Cavium, Inc
>  # Copyright(c) 2020 PANTHEON.tech s.r.o.
> 
> -# for checking defines we need to use the correct compiler flags -march_opt =
> '-march=@0@'.format(machine)
> -
>  arm_force_native_march = false
> -arm_force_generic_march = (machine == 'generic')
> 
>  flags_common_default = [
>  	# Accelarate rte_memcpy. Be sure to run unit test
> (memcpy_perf_autotest) @@ -62,7 +58,6 @@ flags_implementer_armada = [
>  	['RTE_MAX_NUMA_NODES', 1],
>  	['RTE_MAX_LCORE', 16]]
> 
> -flags_part_number_default = []
>  flags_part_number_thunderx = [
>  	['RTE_MACHINE', '"thunderx"'],
>  	['RTE_USE_C11_MEM_MODEL', false]]
> @@ -119,17 +114,9 @@ part_number_config_emag = [  ## Arm implementer
> ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)  implementer_generic
> = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
>  implementer_0x41 = ['Arm', flags_implementer_arm,
> part_number_config_arm]
> -implementer_0x42 = ['Broadcom', flags_implementer_generic,
> part_number_config_arm]
>  implementer_0x43 = ['Cavium', flags_implementer_cavium,
> part_number_config_cavium]
> -implementer_0x44 = ['DEC', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x49 = ['Infineon', flags_implementer_generic,
> part_number_config_arm] -implementer_0x4d = ['Motorola',
> flags_implementer_generic, part_number_config_arm] -implementer_0x4e =
> ['NVIDIA', flags_implementer_generic, part_number_config_arm]
>  implementer_0x50 = ['Ampere Computing', flags_implementer_emag,
> part_number_config_emag]
> -implementer_0x51 = ['Qualcomm', flags_implementer_generic,
> part_number_config_arm]
> -implementer_0x53 = ['Samsung', flags_implementer_generic,
> part_number_config_arm]
>  implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada,
> part_number_config_arm]
> -implementer_0x69 = ['Intel', flags_implementer_generic,
> part_number_config_arm]  implementer_dpaa = ['NXP DPAA',
> flags_implementer_dpaa, part_number_config_arm]
> 
>  dpdk_conf.set('RTE_ARCH_ARM', 1)
> @@ -145,11 +132,9 @@ else
>  	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
>  	dpdk_conf.set('RTE_ARCH_ARM64', 1)
> 
> -	implementer_config = []
> -	cmd_generic = ['generic', '', '', 'generic', '']
> -	cmd_output = cmd_generic # Set generic by default
> +	implementer_id = 'generic'
>  	machine_args = [] # Clear previous machine args
> -	if arm_force_generic_march and not meson.is_cross_build()
> +	if machine == 'generic' and not meson.is_cross_build()
>  		implementer_config = implementer_generic
>  		part_number = 'generic'
>  	elif not meson.is_cross_build()
> @@ -160,14 +145,15 @@ else
>  		cmd = run_command(detect_vendor.path())
>  		if cmd.returncode() == 0
>  			cmd_output = cmd.stdout().to_lower().strip().split(' ')
> +			implementer_id = cmd_output[0]
> +			part_number = cmd_output[3]
>  		endif
>  		# Set to generic if variable is not found
> -		implementer_config = get_variable('implementer_' +
> cmd_output[0], ['generic'])
> +		implementer_config = get_variable('implementer_' +
> implementer_id,
> +['generic'])
>  		if implementer_config[0] == 'generic'
>  			implementer_config = implementer_generic
> -			cmd_output = cmd_generic
> +			part_number = 'generic'
>  		endif
> -		part_number = cmd_output[3]
>  		if arm_force_native_march == true
>  			part_number = 'native'
>  		endif
> @@ -200,7 +186,7 @@ else
>  				endif
>  			endforeach
>  			# Apply any extra machine specific flags.
> -			foreach flag: marg.get(2, flags_part_number_default)
> +			foreach flag: marg.get(2, [])
>  				if flag.length() > 0
>  					dpdk_conf.set(flag[0], flag[1])
>  				endif
> --
> 2.20.1
diff mbox series

Patch

diff --git a/config/arm/meson.build b/config/arm/meson.build
index 7fe0f3f3c..7c7059cc2 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -3,11 +3,7 @@ 
 # Copyright(c) 2017 Cavium, Inc
 # Copyright(c) 2020 PANTHEON.tech s.r.o.
 
-# for checking defines we need to use the correct compiler flags
-march_opt = '-march=@0@'.format(machine)
-
 arm_force_native_march = false
-arm_force_generic_march = (machine == 'generic')
 
 flags_common_default = [
 	# Accelarate rte_memcpy. Be sure to run unit test (memcpy_perf_autotest)
@@ -62,7 +58,6 @@  flags_implementer_armada = [
 	['RTE_MAX_NUMA_NODES', 1],
 	['RTE_MAX_LCORE', 16]]
 
-flags_part_number_default = []
 flags_part_number_thunderx = [
 	['RTE_MACHINE', '"thunderx"'],
 	['RTE_USE_C11_MEM_MODEL', false]]
@@ -119,17 +114,9 @@  part_number_config_emag = [
 ## Arm implementer ID (ARM DDI 0487C.a, Section G7.2.106, Page G7-5321)
 implementer_generic = ['Generic armv8', flags_implementer_generic, part_number_config_arm]
 implementer_0x41 = ['Arm', flags_implementer_arm, part_number_config_arm]
-implementer_0x42 = ['Broadcom', flags_implementer_generic, part_number_config_arm]
 implementer_0x43 = ['Cavium', flags_implementer_cavium, part_number_config_cavium]
-implementer_0x44 = ['DEC', flags_implementer_generic, part_number_config_arm]
-implementer_0x49 = ['Infineon', flags_implementer_generic, part_number_config_arm]
-implementer_0x4d = ['Motorola', flags_implementer_generic, part_number_config_arm]
-implementer_0x4e = ['NVIDIA', flags_implementer_generic, part_number_config_arm]
 implementer_0x50 = ['Ampere Computing', flags_implementer_emag, part_number_config_emag]
-implementer_0x51 = ['Qualcomm', flags_implementer_generic, part_number_config_arm]
-implementer_0x53 = ['Samsung', flags_implementer_generic, part_number_config_arm]
 implementer_0x56 = ['Marvell ARMADA', flags_implementer_armada, part_number_config_arm]
-implementer_0x69 = ['Intel', flags_implementer_generic, part_number_config_arm]
 implementer_dpaa = ['NXP DPAA', flags_implementer_dpaa, part_number_config_arm]
 
 dpdk_conf.set('RTE_ARCH_ARM', 1)
@@ -145,11 +132,9 @@  else
 	dpdk_conf.set('RTE_CACHE_LINE_SIZE', 128)
 	dpdk_conf.set('RTE_ARCH_ARM64', 1)
 
-	implementer_config = []
-	cmd_generic = ['generic', '', '', 'generic', '']
-	cmd_output = cmd_generic # Set generic by default
+	implementer_id = 'generic'
 	machine_args = [] # Clear previous machine args
-	if arm_force_generic_march and not meson.is_cross_build()
+	if machine == 'generic' and not meson.is_cross_build()
 		implementer_config = implementer_generic
 		part_number = 'generic'
 	elif not meson.is_cross_build()
@@ -160,14 +145,15 @@  else
 		cmd = run_command(detect_vendor.path())
 		if cmd.returncode() == 0
 			cmd_output = cmd.stdout().to_lower().strip().split(' ')
+			implementer_id = cmd_output[0]
+			part_number = cmd_output[3]
 		endif
 		# Set to generic if variable is not found
-		implementer_config = get_variable('implementer_' + cmd_output[0], ['generic'])
+		implementer_config = get_variable('implementer_' + implementer_id, ['generic'])
 		if implementer_config[0] == 'generic'
 			implementer_config = implementer_generic
-			cmd_output = cmd_generic
+			part_number = 'generic'
 		endif
-		part_number = cmd_output[3]
 		if arm_force_native_march == true
 			part_number = 'native'
 		endif
@@ -200,7 +186,7 @@  else
 				endif
 			endforeach
 			# Apply any extra machine specific flags.
-			foreach flag: marg.get(2, flags_part_number_default)
+			foreach flag: marg.get(2, [])
 				if flag.length() > 0
 					dpdk_conf.set(flag[0], flag[1])
 				endif