[dpdk-dev] [v21.02 v3 09/10] app/crypto-perf: remove always true condition

Zhang, Roy Fan roy.fan.zhang at intel.com
Mon Nov 23 16:25:38 CET 2020


> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Thursday, November 19, 2020 11:59 AM
> To: dev at dpdk.org; Doherty, Declan <declan.doherty at intel.com>; Kerlin,
> Marcin <marcin.kerlin at intel.com>; Mrozowicz, SlawomirX
> <slawomirx.mrozowicz at intel.com>; Kobylinski, Michal
> <michal.kobylinski at intel.com>; Piotr Azarewicz
> <piotrx.t.azarewicz at intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; stable at dpdk.org
> Subject: [dpdk-dev] [v21.02 v3 09/10] app/crypto-perf: remove always true
> condition
> 
> This is already 'else' leg of the opposite comparison, simple 'else'
> will be logically same.
> 
> Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test
> application")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> ---
>  app/test-crypto-perf/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
> index 5f035519c3..99f86e9019 100644
> --- a/app/test-crypto-perf/main.c
> +++ b/app/test-crypto-perf/main.c
> @@ -390,7 +390,7 @@ cperf_check_test_vector(struct cperf_options *opts,
>  		if (opts->cipher_algo == RTE_CRYPTO_CIPHER_NULL) {
>  			if (test_vec->plaintext.data == NULL)
>  				return -1;
> -		} else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
> +		} else {
>  			if (test_vec->plaintext.data == NULL)
>  				return -1;
>  			if (test_vec->plaintext.length < opts-
> >max_buffer_size)
> @@ -440,7 +440,7 @@ cperf_check_test_vector(struct cperf_options *opts,
>  				return -1;
>  			if (test_vec->plaintext.length < opts-
> >max_buffer_size)
>  				return -1;
> -		} else if (opts->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
> +		} else {
>  			if (test_vec->plaintext.data == NULL)
>  				return -1;
>  			if (test_vec->plaintext.length < opts-
> >max_buffer_size)
> --
> 2.26.2

Thanks Ferruh!

Acked-by: Fan Zhang <roy.fan.zhang at intel.com>



More information about the dev mailing list