crypto: talitos – use IS_ENABLED() in has_ftr_sec1() [Linux 5.3]

This Linux kernel change "crypto: talitos – use IS_ENABLED() in has_ftr_sec1()" is included in the Linux 5.3 release. This change is authored by Christophe Leroy <christophe.leroy [at] c-s.fr> on Tue May 21 13:34:21 2019 +0000. The commit for this change in Linux stable tree is 89b32df (patch).

crypto: talitos - use IS_ENABLED() in has_ftr_sec1()

This patch rewrites has_ftr_sec1() using IS_ENABLED()
instead of #ifdefs

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

There are 12 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/crypto/talitos.h | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h
index 95e9795..5699d46 100644
--- a/drivers/crypto/talitos.h
+++ b/drivers/crypto/talitos.h
@@ -164,13 +164,11 @@ struct talitos_private {
  */
 static inline bool has_ftr_sec1(struct talitos_private *priv)
 {
-#if defined(CONFIG_CRYPTO_DEV_TALITOS1) && defined(CONFIG_CRYPTO_DEV_TALITOS2)
-   return priv->features & TALITOS_FTR_SEC1 ? true : false;
-#elif defined(CONFIG_CRYPTO_DEV_TALITOS1)
-   return true;
-#else
-   return false;
-#endif
+   if (IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS1) &&
+       IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS2))
+       return priv->features & TALITOS_FTR_SEC1;
+
+   return IS_ENABLED(CONFIG_CRYPTO_DEV_TALITOS1);
 }

 /*

Leave a Reply

Your email address will not be published. Required fields are marked *