Skip to content

Commit c7b31c8

Browse files
Gilad Ben-Yossefherbertx
authored andcommitted
crypto: ccree - turn errors to debug msgs
We have several loud error log messages that are already reported via the normal return code mechanism and produce a lot of noise when the new testmgr extra test are enabled. Turn these into debug only messages Signed-off-by: Gilad Ben-Yossef <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 2a6bc71 commit c7b31c8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/crypto/ccree/cc_aead.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,21 +385,21 @@ static int validate_keys_sizes(struct cc_aead_ctx *ctx)
385385
return -EINVAL;
386386
break;
387387
default:
388-
dev_err(dev, "Invalid auth_mode=%d\n", ctx->auth_mode);
388+
dev_dbg(dev, "Invalid auth_mode=%d\n", ctx->auth_mode);
389389
return -EINVAL;
390390
}
391391
/* Check cipher key size */
392392
if (ctx->flow_mode == S_DIN_to_DES) {
393393
if (ctx->enc_keylen != DES3_EDE_KEY_SIZE) {
394-
dev_err(dev, "Invalid cipher(3DES) key size: %u\n",
394+
dev_dbg(dev, "Invalid cipher(3DES) key size: %u\n",
395395
ctx->enc_keylen);
396396
return -EINVAL;
397397
}
398398
} else { /* Default assumed to be AES ciphers */
399399
if (ctx->enc_keylen != AES_KEYSIZE_128 &&
400400
ctx->enc_keylen != AES_KEYSIZE_192 &&
401401
ctx->enc_keylen != AES_KEYSIZE_256) {
402-
dev_err(dev, "Invalid cipher(AES) key size: %u\n",
402+
dev_dbg(dev, "Invalid cipher(AES) key size: %u\n",
403403
ctx->enc_keylen);
404404
return -EINVAL;
405405
}
@@ -1559,7 +1559,7 @@ static int config_ccm_adata(struct aead_request *req)
15591559
/* taken from crypto/ccm.c */
15601560
/* 2 <= L <= 8, so 1 <= L' <= 7. */
15611561
if (l < 2 || l > 8) {
1562-
dev_err(dev, "illegal iv value %X\n", req->iv[0]);
1562+
dev_dbg(dev, "illegal iv value %X\n", req->iv[0]);
15631563
return -EINVAL;
15641564
}
15651565
memcpy(b0, req->iv, AES_BLOCK_SIZE);
@@ -2056,7 +2056,7 @@ static int cc_rfc4309_ccm_encrypt(struct aead_request *req)
20562056
int rc = -EINVAL;
20572057

20582058
if (!valid_assoclen(req)) {
2059-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2059+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
20602060
goto out;
20612061
}
20622062

@@ -2106,7 +2106,7 @@ static int cc_rfc4309_ccm_decrypt(struct aead_request *req)
21062106
int rc = -EINVAL;
21072107

21082108
if (!valid_assoclen(req)) {
2109-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2109+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
21102110
goto out;
21112111
}
21122112

@@ -2225,7 +2225,7 @@ static int cc_rfc4106_gcm_encrypt(struct aead_request *req)
22252225
int rc = -EINVAL;
22262226

22272227
if (!valid_assoclen(req)) {
2228-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2228+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
22292229
goto out;
22302230
}
22312231

@@ -2256,7 +2256,7 @@ static int cc_rfc4543_gcm_encrypt(struct aead_request *req)
22562256
int rc = -EINVAL;
22572257

22582258
if (!valid_assoclen(req)) {
2259-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2259+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
22602260
goto out;
22612261
}
22622262

@@ -2290,7 +2290,7 @@ static int cc_rfc4106_gcm_decrypt(struct aead_request *req)
22902290
int rc = -EINVAL;
22912291

22922292
if (!valid_assoclen(req)) {
2293-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2293+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
22942294
goto out;
22952295
}
22962296

@@ -2321,7 +2321,7 @@ static int cc_rfc4543_gcm_decrypt(struct aead_request *req)
23212321
int rc = -EINVAL;
23222322

23232323
if (!valid_assoclen(req)) {
2324-
dev_err(dev, "invalid Assoclen:%u\n", req->assoclen);
2324+
dev_dbg(dev, "invalid Assoclen:%u\n", req->assoclen);
23252325
goto out;
23262326
}
23272327

drivers/crypto/ccree/cc_cipher.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int cc_cipher_sethkey(struct crypto_skcipher *sktfm, const u8 *key,
302302
keylen = hki.keylen;
303303

304304
if (validate_keys_sizes(ctx_p, keylen)) {
305-
dev_err(dev, "Unsupported key size %d.\n", keylen);
305+
dev_dbg(dev, "Unsupported key size %d.\n", keylen);
306306
return -EINVAL;
307307
}
308308

@@ -392,7 +392,7 @@ static int cc_cipher_setkey(struct crypto_skcipher *sktfm, const u8 *key,
392392
/* STAT_PHASE_0: Init and sanity checks */
393393

394394
if (validate_keys_sizes(ctx_p, keylen)) {
395-
dev_err(dev, "Unsupported key size %d.\n", keylen);
395+
dev_dbg(dev, "Unsupported key size %d.\n", keylen);
396396
return -EINVAL;
397397
}
398398

@@ -833,7 +833,7 @@ static int cc_cipher_process(struct skcipher_request *req,
833833

834834
/* TODO: check data length according to mode */
835835
if (validate_data_size(ctx_p, nbytes)) {
836-
dev_err(dev, "Unsupported data size %d.\n", nbytes);
836+
dev_dbg(dev, "Unsupported data size %d.\n", nbytes);
837837
rc = -EINVAL;
838838
goto exit_process;
839839
}

0 commit comments

Comments
 (0)