diff mbox

[PATCHv2,2/2] linux-generic: odp_crypto_operation merge 2 ifs

Message ID 1425037871-28253-2-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit c3f2ef2f3737829e1ccef1cc7a9be3f774b6b3fb
Headers show

Commit Message

Maxim Uvarov Feb. 27, 2015, 11:51 a.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_crypto.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Bill Fischofer Feb. 27, 2015, 1:35 p.m. UTC | #1
On Fri, Feb 27, 2015 at 5:51 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/odp_crypto.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/platform/linux-generic/odp_crypto.c
> b/platform/linux-generic/odp_crypto.c
> index 4998b8a..b16316c 100644
> --- a/platform/linux-generic/odp_crypto.c
> +++ b/platform/linux-generic/odp_crypto.c
> @@ -380,11 +380,10 @@ odp_crypto_operation(odp_crypto_op_params_t *params,
>         session = (odp_crypto_generic_session_t
> *)(intptr_t)params->session;
>
>         /* Resolve output buffer */
> -       if (ODP_PACKET_INVALID == params->out_pkt)
> -               if (ODP_POOL_INVALID != session->output_pool)
> -                       params->out_pkt =
> -                               odp_packet_alloc(session->output_pool,
> -
> odp_packet_len(params->pkt));
> +       if (ODP_PACKET_INVALID == params->out_pkt &&
> +           ODP_POOL_INVALID != session->output_pool)
> +               params->out_pkt = odp_packet_alloc(session->output_pool,
> +                               odp_packet_len(params->pkt));
>         if (params->pkt != params->out_pkt) {
>                 if (odp_unlikely(ODP_PACKET_INVALID == params->out_pkt))
>                         ODP_ABORT();
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Feb. 27, 2015, 2 p.m. UTC | #2
Merged to be in 1.0 (bugfix).

Maxim.

On 02/27/2015 04:35 PM, Bill Fischofer wrote:
>
>
> On Fri, Feb 27, 2015 at 5:51 AM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      platform/linux-generic/odp_crypto.c | 9 ++++-----
>      1 file changed, 4 insertions(+), 5 deletions(-)
>
>     diff --git a/platform/linux-generic/odp_crypto.c
>     b/platform/linux-generic/odp_crypto.c
>     index 4998b8a..b16316c 100644
>     --- a/platform/linux-generic/odp_crypto.c
>     +++ b/platform/linux-generic/odp_crypto.c
>     @@ -380,11 +380,10 @@ odp_crypto_operation(odp_crypto_op_params_t
>     *params,
>             session = (odp_crypto_generic_session_t
>     *)(intptr_t)params->session;
>
>             /* Resolve output buffer */
>     -       if (ODP_PACKET_INVALID == params->out_pkt)
>     -               if (ODP_POOL_INVALID != session->output_pool)
>     -                       params->out_pkt =
>     -  odp_packet_alloc(session->output_pool,
>     - odp_packet_len(params->pkt));
>     +       if (ODP_PACKET_INVALID == params->out_pkt &&
>     +           ODP_POOL_INVALID != session->output_pool)
>     +               params->out_pkt =
>     odp_packet_alloc(session->output_pool,
>     +  odp_packet_len(params->pkt));
>             if (params->pkt != params->out_pkt) {
>                     if (odp_unlikely(ODP_PACKET_INVALID ==
>     params->out_pkt))
>                             ODP_ABORT();
>     --
>     1.8.5.1.163.gd7aced9
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c
index 4998b8a..b16316c 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -380,11 +380,10 @@  odp_crypto_operation(odp_crypto_op_params_t *params,
 	session = (odp_crypto_generic_session_t *)(intptr_t)params->session;
 
 	/* Resolve output buffer */
-	if (ODP_PACKET_INVALID == params->out_pkt)
-		if (ODP_POOL_INVALID != session->output_pool)
-			params->out_pkt =
-				odp_packet_alloc(session->output_pool,
-						 odp_packet_len(params->pkt));
+	if (ODP_PACKET_INVALID == params->out_pkt &&
+	    ODP_POOL_INVALID != session->output_pool)
+		params->out_pkt = odp_packet_alloc(session->output_pool,
+				odp_packet_len(params->pkt));
 	if (params->pkt != params->out_pkt) {
 		if (odp_unlikely(ODP_PACKET_INVALID == params->out_pkt))
 			ODP_ABORT();