Skip to contentSkip to conversation

crypto: shash - don't exclude async statuses from error stats

PATCH In review Eric Biggers 2 participants 2 messages Oct 29, 2023 – Nov 17, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: shash - don't exclude async statuses from error stats

From: Eric Biggers <[email protected]>

EINPROGRESS and EBUSY have special meaning for async operations. However, shash is always synchronous, so these statuses have no special meaning for shash and don't need to be excluded when handling errors.

---
 crypto/shash.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
crypto/shash.c +1 -5
index d5194221c88c..c3f7f6a25280 100644
@@ -16,26 +16,22 @@
 
 #include "hash.h"
 
 static inline struct crypto_istat_hash *shash_get_stat(struct shash_alg *alg)
 {
 	return hash_get_stat(&alg->halg);
 }
 
 static inline int crypto_shash_errstat(struct shash_alg *alg, int err)
 {
-	if (!IS_ENABLED(CONFIG_CRYPTO_STATS))
-		return err;
-
-	if (err && err != -EINPROGRESS && err != -EBUSY)
+	if (IS_ENABLED(CONFIG_CRYPTO_STATS) && err)
 		atomic64_inc(&shash_get_stat(alg)->err_cnt);
-
 	return err;
 }
 
 int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
 		    unsigned int keylen)
 {
 	return -ENOSYS;
 }
 EXPORT_SYMBOL_GPL(shash_no_setkey);
 

base-commit: f2b88bab69c86d4dab2bfd25a0e741d7df411f7a

Signature · 1 line
2.42.0
maintainer
#1 lore raw
Quoted 10 lines · Eric Biggers

From: Eric Biggers <[email protected]>

EINPROGRESS and EBUSY have special meaning for async operations. However, shash is always synchronous, so these statuses have no special meaning for shash and don't need to be excluded when handling errors.

---
crypto/shash.c | 6 +-----

1 file changed, 1 insertion(+), 5 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt