diff mbox

crypto: acomp - report scomp implementations

Message ID 20170419132614.3363-1-giovanni.cabiddu@intel.com (mailing list archive)
State Changes Requested
Delegated to: Herbert Xu
Headers show

Commit Message

Cabiddu, Giovanni April 19, 2017, 1:26 p.m. UTC
Fix crypto_has_acomp to report scomp implementations.

Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
---
 include/crypto/acompress.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Herbert Xu April 21, 2017, 11:39 a.m. UTC | #1
On Wed, Apr 19, 2017 at 02:26:14PM +0100, Giovanni Cabiddu wrote:
> Fix crypto_has_acomp to report scomp implementations.
> 
> Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
> ---
>  include/crypto/acompress.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h
> index e328b52..39871f9 100644
> --- a/include/crypto/acompress.h
> +++ b/include/crypto/acompress.h
> @@ -162,6 +162,7 @@ static inline int crypto_has_acomp(const char *alg_name, u32 type, u32 mask)
>  {
>  	type &= ~CRYPTO_ALG_TYPE_MASK;
>  	type |= CRYPTO_ALG_TYPE_ACOMPRESS;
> +	type |= CRYPTO_ALG_TYPE_SCOMPRESS;
>  	mask |= CRYPTO_ALG_TYPE_MASK;
>  
>  	return crypto_has_alg(alg_name, type, mask);

Are you sure this works? I think you should modify the mask instead.

Cheers,
diff mbox

Patch

diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h
index e328b52..39871f9 100644
--- a/include/crypto/acompress.h
+++ b/include/crypto/acompress.h
@@ -162,6 +162,7 @@  static inline int crypto_has_acomp(const char *alg_name, u32 type, u32 mask)
 {
 	type &= ~CRYPTO_ALG_TYPE_MASK;
 	type |= CRYPTO_ALG_TYPE_ACOMPRESS;
+	type |= CRYPTO_ALG_TYPE_SCOMPRESS;
 	mask |= CRYPTO_ALG_TYPE_MASK;
 
 	return crypto_has_alg(alg_name, type, mask);