Message ID | 20200831075832.3827-1-andriy.shevchenko@linux.intel.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | [v1] crypto: caam - use traditional error check pattern | expand |
On 8/31/2020 10:58 AM, Andy Shevchenko wrote: > Use traditional error check pattern > ret = ...; > if (ret) > return ret; > ... > instead of checking error code to be 0. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> > --- > drivers/crypto/caam/ctrl.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c > index 65de57f169d9..25785404a58e 100644 > --- a/drivers/crypto/caam/ctrl.c > +++ b/drivers/crypto/caam/ctrl.c > @@ -333,11 +333,10 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, > > kfree(desc); > > - if (!ret) > - ret = devm_add_action_or_reset(ctrldev, devm_deinstantiate_rng, > - ctrldev); > + if (ret) > + return ret; > > - return ret; > + return devm_add_action_or_reset(ctrldev, devm_deinstantiate_rng, ctrldev); > } > > /* >
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > Use traditional error check pattern > ret = ...; > if (ret) > return ret; > ... > instead of checking error code to be 0. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/crypto/caam/ctrl.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) Patch applied. Thanks.
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 65de57f169d9..25785404a58e 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -333,11 +333,10 @@ static int instantiate_rng(struct device *ctrldev, int state_handle_mask, kfree(desc); - if (!ret) - ret = devm_add_action_or_reset(ctrldev, devm_deinstantiate_rng, - ctrldev); + if (ret) + return ret; - return ret; + return devm_add_action_or_reset(ctrldev, devm_deinstantiate_rng, ctrldev); } /*
Use traditional error check pattern ret = ...; if (ret) return ret; ... instead of checking error code to be 0. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/crypto/caam/ctrl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)