]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/crypto/algapi.h
Merge branch 'perf/urgent' into perf/core, to pick up fixes
[karo-tx-linux.git] / include / crypto / algapi.h
index ebe4ded0c55d7ffcefe6e20e2ddc7cb738e2f7cd..436c4c2683c7dc81921cb029178967bf0e665abd 100644 (file)
@@ -360,13 +360,18 @@ static inline struct crypto_alg *crypto_get_attr_alg(struct rtattr **tb,
        return crypto_attr_alg(tb[1], type, mask);
 }
 
+static inline int crypto_requires_off(u32 type, u32 mask, u32 off)
+{
+       return (type ^ off) & mask & off;
+}
+
 /*
  * Returns CRYPTO_ALG_ASYNC if type/mask requires the use of sync algorithms.
  * Otherwise returns zero.
  */
 static inline int crypto_requires_sync(u32 type, u32 mask)
 {
-       return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC;
+       return crypto_requires_off(type, mask, CRYPTO_ALG_ASYNC);
 }
 
 noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);