@@ -141,9 +141,11 @@ static int mv_cesa_ahash_pad_req(struct mv_cesa_ahash_req *creq, u8 *buf)
141141
142142 if (creq -> algo_le ) {
143143 __le64 bits = cpu_to_le64 (creq -> len << 3 );
144+
144145 memcpy (buf + padlen , & bits , sizeof (bits ));
145146 } else {
146147 __be64 bits = cpu_to_be64 (creq -> len << 3 );
148+
147149 memcpy (buf + padlen , & bits , sizeof (bits ));
148150 }
149151
@@ -168,7 +170,8 @@ static void mv_cesa_ahash_std_step(struct ahash_request *req)
168170 if (!sreq -> offset ) {
169171 digsize = crypto_ahash_digestsize (crypto_ahash_reqtfm (req ));
170172 for (i = 0 ; i < digsize / 4 ; i ++ )
171- writel_relaxed (creq -> state [i ], engine -> regs + CESA_IVDIG (i ));
173+ writel_relaxed (creq -> state [i ],
174+ engine -> regs + CESA_IVDIG (i ));
172175 }
173176
174177 if (creq -> cache_ptr )
@@ -245,8 +248,8 @@ static void mv_cesa_ahash_std_step(struct ahash_request *req)
245248
246249 mv_cesa_set_int_mask (engine , CESA_SA_INT_ACCEL0_DONE );
247250 writel_relaxed (CESA_SA_CFG_PARA_DIS , engine -> regs + CESA_SA_CFG );
248- BUG_ON (readl (engine -> regs + CESA_SA_CMD ) &
249- CESA_SA_CMD_EN_CESA_SA_ACCL0 );
251+ WARN_ON (readl (engine -> regs + CESA_SA_CMD ) &
252+ CESA_SA_CMD_EN_CESA_SA_ACCL0 );
250253 writel (CESA_SA_CMD_EN_CESA_SA_ACCL0 , engine -> regs + CESA_SA_CMD );
251254}
252255
@@ -329,11 +332,12 @@ static void mv_cesa_ahash_complete(struct crypto_async_request *req)
329332 digsize = crypto_ahash_digestsize (crypto_ahash_reqtfm (ahashreq ));
330333
331334 if (mv_cesa_req_get_type (& creq -> base ) == CESA_DMA_REQ &&
332- (creq -> base .chain .last -> flags & CESA_TDMA_TYPE_MSK ) == CESA_TDMA_RESULT ) {
335+ (creq -> base .chain .last -> flags & CESA_TDMA_TYPE_MSK ) ==
336+ CESA_TDMA_RESULT ) {
333337 __le32 * data = NULL ;
334338
335339 /*
336- * Result is already in the correct endianess when the SA is
340+ * Result is already in the correct endianness when the SA is
337341 * used
338342 */
339343 data = creq -> base .chain .last -> op -> ctx .hash .hash ;
@@ -347,9 +351,9 @@ static void mv_cesa_ahash_complete(struct crypto_async_request *req)
347351 CESA_IVDIG (i ));
348352 if (creq -> last_req ) {
349353 /*
350- * Hardware's MD5 digest is in little endian format, but
351- * SHA in big endian format
352- */
354+ * Hardware's MD5 digest is in little endian format, but
355+ * SHA in big endian format
356+ */
353357 if (creq -> algo_le ) {
354358 __le32 * result = (void * )ahashreq -> result ;
355359
@@ -439,7 +443,8 @@ static bool mv_cesa_ahash_cache_req(struct ahash_request *req)
439443 struct mv_cesa_ahash_req * creq = ahash_request_ctx (req );
440444 bool cached = false;
441445
442- if (creq -> cache_ptr + req -> nbytes < CESA_MAX_HASH_BLOCK_SIZE && !creq -> last_req ) {
446+ if (creq -> cache_ptr + req -> nbytes < CESA_MAX_HASH_BLOCK_SIZE &&
447+ !creq -> last_req ) {
443448 cached = true;
444449
445450 if (!req -> nbytes )
@@ -648,7 +653,8 @@ static int mv_cesa_ahash_dma_req_init(struct ahash_request *req)
648653 if (!mv_cesa_ahash_req_iter_next_op (& iter ))
649654 break ;
650655
651- op = mv_cesa_dma_add_frag (& basereq -> chain , & creq -> op_tmpl ,
656+ op = mv_cesa_dma_add_frag (& basereq -> chain ,
657+ & creq -> op_tmpl ,
652658 frag_len , flags );
653659 if (IS_ERR (op )) {
654660 ret = PTR_ERR (op );
@@ -920,7 +926,7 @@ struct ahash_alg mv_md5_alg = {
920926 .cra_ctxsize = sizeof (struct mv_cesa_hash_ctx ),
921927 .cra_init = mv_cesa_ahash_cra_init ,
922928 .cra_module = THIS_MODULE ,
923- }
929+ }
924930 }
925931};
926932
@@ -990,7 +996,7 @@ struct ahash_alg mv_sha1_alg = {
990996 .cra_ctxsize = sizeof (struct mv_cesa_hash_ctx ),
991997 .cra_init = mv_cesa_ahash_cra_init ,
992998 .cra_module = THIS_MODULE ,
993- }
999+ }
9941000 }
9951001};
9961002
@@ -1063,7 +1069,7 @@ struct ahash_alg mv_sha256_alg = {
10631069 .cra_ctxsize = sizeof (struct mv_cesa_hash_ctx ),
10641070 .cra_init = mv_cesa_ahash_cra_init ,
10651071 .cra_module = THIS_MODULE ,
1066- }
1072+ }
10671073 }
10681074};
10691075
@@ -1297,7 +1303,7 @@ struct ahash_alg mv_ahmac_md5_alg = {
12971303 .cra_ctxsize = sizeof (struct mv_cesa_hmac_ctx ),
12981304 .cra_init = mv_cesa_ahmac_cra_init ,
12991305 .cra_module = THIS_MODULE ,
1300- }
1306+ }
13011307 }
13021308};
13031309
@@ -1367,7 +1373,7 @@ struct ahash_alg mv_ahmac_sha1_alg = {
13671373 .cra_ctxsize = sizeof (struct mv_cesa_hmac_ctx ),
13681374 .cra_init = mv_cesa_ahmac_cra_init ,
13691375 .cra_module = THIS_MODULE ,
1370- }
1376+ }
13711377 }
13721378};
13731379
@@ -1437,6 +1443,6 @@ struct ahash_alg mv_ahmac_sha256_alg = {
14371443 .cra_ctxsize = sizeof (struct mv_cesa_hmac_ctx ),
14381444 .cra_init = mv_cesa_ahmac_cra_init ,
14391445 .cra_module = THIS_MODULE ,
1440- }
1446+ }
14411447 }
14421448};
0 commit comments