提交 0d207bd4 编写于 作者: G Gilad Ben-Yossef 提交者: Greg Kroah-Hartman

staging: ccree: fix indentation of func params

Fix indentation of some function params in hash code for
better readability.
Signed-off-by: NGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 2c8cdb6b
...@@ -109,8 +109,7 @@ static int cc_map_result(struct device *dev, struct ahash_req_ctx *state, ...@@ -109,8 +109,7 @@ static int cc_map_result(struct device *dev, struct ahash_req_ctx *state,
{ {
state->digest_result_dma_addr = state->digest_result_dma_addr =
dma_map_single(dev, state->digest_result_buff, dma_map_single(dev, state->digest_result_buff,
digestsize, digestsize, DMA_BIDIRECTIONAL);
DMA_BIDIRECTIONAL);
if (dma_mapping_error(dev, state->digest_result_dma_addr)) { if (dma_mapping_error(dev, state->digest_result_dma_addr)) {
dev_err(dev, "Mapping digest result buffer %u B for DMA failed\n", dev_err(dev, "Mapping digest result buffer %u B for DMA failed\n",
digestsize); digestsize);
...@@ -264,16 +263,12 @@ static void cc_unmap_result(struct device *dev, struct ahash_req_ctx *state, ...@@ -264,16 +263,12 @@ static void cc_unmap_result(struct device *dev, struct ahash_req_ctx *state,
unsigned int digestsize, u8 *result) unsigned int digestsize, u8 *result)
{ {
if (state->digest_result_dma_addr) { if (state->digest_result_dma_addr) {
dma_unmap_single(dev, dma_unmap_single(dev, state->digest_result_dma_addr, digestsize,
state->digest_result_dma_addr, DMA_BIDIRECTIONAL);
digestsize,
DMA_BIDIRECTIONAL);
dev_dbg(dev, "unmpa digest result buffer va (%pK) pa (%pad) len %u\n", dev_dbg(dev, "unmpa digest result buffer va (%pK) pa (%pad) len %u\n",
state->digest_result_buff, state->digest_result_buff,
&state->digest_result_dma_addr, digestsize); &state->digest_result_dma_addr, digestsize);
memcpy(result, memcpy(result, state->digest_result_buff, digestsize);
state->digest_result_buff,
digestsize);
} }
state->digest_result_dma_addr = 0; state->digest_result_dma_addr = 0;
} }
...@@ -1100,25 +1095,25 @@ static int cc_xcbc_setkey(struct crypto_ahash *ahash, ...@@ -1100,25 +1095,25 @@ static int cc_xcbc_setkey(struct crypto_ahash *ahash,
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_din_const(&desc[idx], 0x01010101, CC_AES_128_BIT_KEY_SIZE); set_din_const(&desc[idx], 0x01010101, CC_AES_128_BIT_KEY_SIZE);
set_flow_mode(&desc[idx], DIN_AES_DOUT); set_flow_mode(&desc[idx], DIN_AES_DOUT);
set_dout_dlli(&desc[idx], (ctx->opad_tmp_keys_dma_addr + set_dout_dlli(&desc[idx],
XCBC_MAC_K1_OFFSET), (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K1_OFFSET),
CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0); CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0);
idx++; idx++;
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_din_const(&desc[idx], 0x02020202, CC_AES_128_BIT_KEY_SIZE); set_din_const(&desc[idx], 0x02020202, CC_AES_128_BIT_KEY_SIZE);
set_flow_mode(&desc[idx], DIN_AES_DOUT); set_flow_mode(&desc[idx], DIN_AES_DOUT);
set_dout_dlli(&desc[idx], (ctx->opad_tmp_keys_dma_addr + set_dout_dlli(&desc[idx],
XCBC_MAC_K2_OFFSET), (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K2_OFFSET),
CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0); CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0);
idx++; idx++;
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_din_const(&desc[idx], 0x03030303, CC_AES_128_BIT_KEY_SIZE); set_din_const(&desc[idx], 0x03030303, CC_AES_128_BIT_KEY_SIZE);
set_flow_mode(&desc[idx], DIN_AES_DOUT); set_flow_mode(&desc[idx], DIN_AES_DOUT);
set_dout_dlli(&desc[idx], (ctx->opad_tmp_keys_dma_addr + set_dout_dlli(&desc[idx],
XCBC_MAC_K3_OFFSET), (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K3_OFFSET),
CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0); CC_AES_128_BIT_KEY_SIZE, NS_BIT, 0);
idx++; idx++;
rc = cc_send_sync_request(ctx->drvdata, &cc_req, desc, idx); rc = cc_send_sync_request(ctx->drvdata, &cc_req, desc, idx);
...@@ -1245,8 +1240,7 @@ static int cc_cra_init(struct crypto_tfm *tfm) ...@@ -1245,8 +1240,7 @@ static int cc_cra_init(struct crypto_tfm *tfm)
struct ahash_alg *ahash_alg = struct ahash_alg *ahash_alg =
container_of(hash_alg_common, struct ahash_alg, halg); container_of(hash_alg_common, struct ahash_alg, halg);
struct cc_hash_alg *cc_alg = struct cc_hash_alg *cc_alg =
container_of(ahash_alg, struct cc_hash_alg, container_of(ahash_alg, struct cc_hash_alg, ahash_alg);
ahash_alg);
crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
sizeof(struct ahash_req_ctx)); sizeof(struct ahash_req_ctx));
...@@ -1391,8 +1385,8 @@ static int cc_mac_final(struct ahash_request *req) ...@@ -1391,8 +1385,8 @@ static int cc_mac_final(struct ahash_request *req)
set_cipher_mode(&desc[idx], DRV_CIPHER_ECB); set_cipher_mode(&desc[idx], DRV_CIPHER_ECB);
set_cipher_config0(&desc[idx], DRV_CRYPTO_DIRECTION_DECRYPT); set_cipher_config0(&desc[idx], DRV_CRYPTO_DIRECTION_DECRYPT);
set_din_type(&desc[idx], DMA_DLLI, set_din_type(&desc[idx], DMA_DLLI,
(ctx->opad_tmp_keys_dma_addr + (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K1_OFFSET),
XCBC_MAC_K1_OFFSET), key_size, NS_BIT); key_size, NS_BIT);
set_key_size_aes(&desc[idx], key_len); set_key_size_aes(&desc[idx], key_len);
set_flow_mode(&desc[idx], S_DIN_to_AES); set_flow_mode(&desc[idx], S_DIN_to_AES);
set_setup_mode(&desc[idx], SETUP_LOAD_KEY0); set_setup_mode(&desc[idx], SETUP_LOAD_KEY0);
...@@ -2197,8 +2191,8 @@ static void cc_setup_xcbc(struct ahash_request *areq, struct cc_hw_desc desc[], ...@@ -2197,8 +2191,8 @@ static void cc_setup_xcbc(struct ahash_request *areq, struct cc_hw_desc desc[],
/* Setup XCBC MAC K2 */ /* Setup XCBC MAC K2 */
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_din_type(&desc[idx], DMA_DLLI, (ctx->opad_tmp_keys_dma_addr + set_din_type(&desc[idx], DMA_DLLI,
XCBC_MAC_K2_OFFSET), (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K2_OFFSET),
CC_AES_128_BIT_KEY_SIZE, NS_BIT); CC_AES_128_BIT_KEY_SIZE, NS_BIT);
set_setup_mode(&desc[idx], SETUP_LOAD_STATE1); set_setup_mode(&desc[idx], SETUP_LOAD_STATE1);
set_cipher_mode(&desc[idx], DRV_CIPHER_XCBC_MAC); set_cipher_mode(&desc[idx], DRV_CIPHER_XCBC_MAC);
...@@ -2209,8 +2203,8 @@ static void cc_setup_xcbc(struct ahash_request *areq, struct cc_hw_desc desc[], ...@@ -2209,8 +2203,8 @@ static void cc_setup_xcbc(struct ahash_request *areq, struct cc_hw_desc desc[],
/* Setup XCBC MAC K3 */ /* Setup XCBC MAC K3 */
hw_desc_init(&desc[idx]); hw_desc_init(&desc[idx]);
set_din_type(&desc[idx], DMA_DLLI, (ctx->opad_tmp_keys_dma_addr + set_din_type(&desc[idx], DMA_DLLI,
XCBC_MAC_K3_OFFSET), (ctx->opad_tmp_keys_dma_addr + XCBC_MAC_K3_OFFSET),
CC_AES_128_BIT_KEY_SIZE, NS_BIT); CC_AES_128_BIT_KEY_SIZE, NS_BIT);
set_setup_mode(&desc[idx], SETUP_LOAD_STATE2); set_setup_mode(&desc[idx], SETUP_LOAD_STATE2);
set_cipher_mode(&desc[idx], DRV_CIPHER_XCBC_MAC); set_cipher_mode(&desc[idx], DRV_CIPHER_XCBC_MAC);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册