crypto: talitos - use IS_ENABLED() in has_ftr_sec1()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 21 May 2019 13:34:21 +0000 (13:34 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 30 May 2019 07:30:05 +0000 (15:30 +0800)
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>
drivers/crypto/talitos.h

index 95e97951b9248775820c57a29d1f5f6cf3eb171b..5699d46401e60f0f7a3551185abf1beab4fa49c7 100644 (file)
@@ -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);
 }
 
 /*