Commit cda3e73a authored by Antoine Tenart's avatar Antoine Tenart Committed by Herbert Xu

crypto: inside-secure - use the error handler for invalidation requests

This patch reworks the way invalidation request handlers handle the
result descriptor errors, to use the common error handling function.
This improves the drivers in terms of readability and maintainability.
Suggested-by: default avatarOfer Heifetz <oferh@marvell.com>
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ce43b2e3
...@@ -491,11 +491,8 @@ static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv, ...@@ -491,11 +491,8 @@ static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv,
break; break;
} }
if (rdesc->result_data.error_code) { if (likely(!*ret))
dev_err(priv->dev, "cipher: invalidate: result descriptor error (%d)\n", *ret = safexcel_rdesc_check_errors(priv, rdesc);
rdesc->result_data.error_code);
*ret = -EIO;
}
ndesc++; ndesc++;
} while (!rdesc->last_seg); } while (!rdesc->last_seg);
......
...@@ -369,11 +369,8 @@ static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv, ...@@ -369,11 +369,8 @@ static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv,
dev_err(priv->dev, dev_err(priv->dev,
"hash: invalidate: could not retrieve the result descriptor\n"); "hash: invalidate: could not retrieve the result descriptor\n");
*ret = PTR_ERR(rdesc); *ret = PTR_ERR(rdesc);
} else if (rdesc->result_data.error_code) { } else {
dev_err(priv->dev, *ret = safexcel_rdesc_check_errors(priv, rdesc);
"hash: invalidate: result descriptor error (%d)\n",
rdesc->result_data.error_code);
*ret = -EINVAL;
} }
safexcel_complete(priv, ring); safexcel_complete(priv, ring);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment