Commit 58b0e5d0 authored by Markus Elfring's avatar Markus Elfring Committed by Herbert Xu

crypto: caam - Rename a jump label in five functions

Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d6e7a7d0
...@@ -889,7 +889,7 @@ static int ahash_update_ctx(struct ahash_request *req) ...@@ -889,7 +889,7 @@ static int ahash_update_ctx(struct ahash_request *req)
ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len, ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
edesc->sec4_sg, DMA_BIDIRECTIONAL); edesc->sec4_sg, DMA_BIDIRECTIONAL);
if (ret) if (ret)
goto err; goto unmap_ctx;
state->buf_dma = try_buf_map_to_sec4_sg(jrdev, state->buf_dma = try_buf_map_to_sec4_sg(jrdev,
edesc->sec4_sg + 1, edesc->sec4_sg + 1,
...@@ -919,7 +919,7 @@ static int ahash_update_ctx(struct ahash_request *req) ...@@ -919,7 +919,7 @@ static int ahash_update_ctx(struct ahash_request *req)
if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) {
dev_err(jrdev, "unable to map S/G table\n"); dev_err(jrdev, "unable to map S/G table\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto unmap_ctx;
} }
append_seq_in_ptr(desc, edesc->sec4_sg_dma, ctx->ctx_len + append_seq_in_ptr(desc, edesc->sec4_sg_dma, ctx->ctx_len +
...@@ -935,7 +935,7 @@ static int ahash_update_ctx(struct ahash_request *req) ...@@ -935,7 +935,7 @@ static int ahash_update_ctx(struct ahash_request *req)
ret = caam_jr_enqueue(jrdev, desc, ahash_done_bi, req); ret = caam_jr_enqueue(jrdev, desc, ahash_done_bi, req);
if (ret) if (ret)
goto err; goto unmap_ctx;
ret = -EINPROGRESS; ret = -EINPROGRESS;
} else if (*next_buflen) { } else if (*next_buflen) {
...@@ -953,8 +953,7 @@ static int ahash_update_ctx(struct ahash_request *req) ...@@ -953,8 +953,7 @@ static int ahash_update_ctx(struct ahash_request *req)
#endif #endif
return ret; return ret;
unmap_ctx:
err:
ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_BIDIRECTIONAL); ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_BIDIRECTIONAL);
kfree(edesc); kfree(edesc);
return ret; return ret;
...@@ -996,7 +995,7 @@ static int ahash_final_ctx(struct ahash_request *req) ...@@ -996,7 +995,7 @@ static int ahash_final_ctx(struct ahash_request *req)
ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len, ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
edesc->sec4_sg, DMA_TO_DEVICE); edesc->sec4_sg, DMA_TO_DEVICE);
if (ret) if (ret)
goto err; goto unmap_ctx;
state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1,
buf, state->buf_dma, buflen, buf, state->buf_dma, buflen,
...@@ -1009,7 +1008,7 @@ static int ahash_final_ctx(struct ahash_request *req) ...@@ -1009,7 +1008,7 @@ static int ahash_final_ctx(struct ahash_request *req)
if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) {
dev_err(jrdev, "unable to map S/G table\n"); dev_err(jrdev, "unable to map S/G table\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto unmap_ctx;
} }
append_seq_in_ptr(desc, edesc->sec4_sg_dma, ctx->ctx_len + buflen, append_seq_in_ptr(desc, edesc->sec4_sg_dma, ctx->ctx_len + buflen,
...@@ -1020,7 +1019,7 @@ static int ahash_final_ctx(struct ahash_request *req) ...@@ -1020,7 +1019,7 @@ static int ahash_final_ctx(struct ahash_request *req)
if (dma_mapping_error(jrdev, edesc->dst_dma)) { if (dma_mapping_error(jrdev, edesc->dst_dma)) {
dev_err(jrdev, "unable to map dst\n"); dev_err(jrdev, "unable to map dst\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto unmap_ctx;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -1030,11 +1029,10 @@ static int ahash_final_ctx(struct ahash_request *req) ...@@ -1030,11 +1029,10 @@ static int ahash_final_ctx(struct ahash_request *req)
ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_src, req); ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_src, req);
if (ret) if (ret)
goto err; goto unmap_ctx;
return -EINPROGRESS; return -EINPROGRESS;
unmap_ctx:
err:
ahash_unmap_ctx(jrdev, edesc, req, digestsize, DMA_FROM_DEVICE); ahash_unmap_ctx(jrdev, edesc, req, digestsize, DMA_FROM_DEVICE);
kfree(edesc); kfree(edesc);
return ret; return ret;
...@@ -1094,7 +1092,7 @@ static int ahash_finup_ctx(struct ahash_request *req) ...@@ -1094,7 +1092,7 @@ static int ahash_finup_ctx(struct ahash_request *req)
ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len, ret = ctx_map_to_sec4_sg(desc, jrdev, state, ctx->ctx_len,
edesc->sec4_sg, DMA_TO_DEVICE); edesc->sec4_sg, DMA_TO_DEVICE);
if (ret) if (ret)
goto err; goto unmap_ctx;
state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state->buf_dma = try_buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1,
buf, state->buf_dma, buflen, buf, state->buf_dma, buflen,
...@@ -1104,14 +1102,14 @@ static int ahash_finup_ctx(struct ahash_request *req) ...@@ -1104,14 +1102,14 @@ static int ahash_finup_ctx(struct ahash_request *req)
sec4_sg_src_index, ctx->ctx_len + buflen, sec4_sg_src_index, ctx->ctx_len + buflen,
req->nbytes); req->nbytes);
if (ret) if (ret)
goto err; goto unmap_ctx;
edesc->dst_dma = map_seq_out_ptr_result(desc, jrdev, req->result, edesc->dst_dma = map_seq_out_ptr_result(desc, jrdev, req->result,
digestsize); digestsize);
if (dma_mapping_error(jrdev, edesc->dst_dma)) { if (dma_mapping_error(jrdev, edesc->dst_dma)) {
dev_err(jrdev, "unable to map dst\n"); dev_err(jrdev, "unable to map dst\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto unmap_ctx;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -1121,11 +1119,10 @@ static int ahash_finup_ctx(struct ahash_request *req) ...@@ -1121,11 +1119,10 @@ static int ahash_finup_ctx(struct ahash_request *req)
ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_src, req); ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_src, req);
if (ret) if (ret)
goto err; goto unmap_ctx;
return -EINPROGRESS; return -EINPROGRESS;
unmap_ctx:
err:
ahash_unmap_ctx(jrdev, edesc, req, digestsize, DMA_FROM_DEVICE); ahash_unmap_ctx(jrdev, edesc, req, digestsize, DMA_FROM_DEVICE);
kfree(edesc); kfree(edesc);
return ret; return ret;
...@@ -1350,14 +1347,14 @@ static int ahash_update_no_ctx(struct ahash_request *req) ...@@ -1350,14 +1347,14 @@ static int ahash_update_no_ctx(struct ahash_request *req)
if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) { if (dma_mapping_error(jrdev, edesc->sec4_sg_dma)) {
dev_err(jrdev, "unable to map S/G table\n"); dev_err(jrdev, "unable to map S/G table\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto unmap_ctx;
} }
append_seq_in_ptr(desc, edesc->sec4_sg_dma, to_hash, LDST_SGF); append_seq_in_ptr(desc, edesc->sec4_sg_dma, to_hash, LDST_SGF);
ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len); ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
if (ret) if (ret)
goto err; goto unmap_ctx;
#ifdef DEBUG #ifdef DEBUG
print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ", print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ",
...@@ -1367,7 +1364,7 @@ static int ahash_update_no_ctx(struct ahash_request *req) ...@@ -1367,7 +1364,7 @@ static int ahash_update_no_ctx(struct ahash_request *req)
ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_dst, req); ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_dst, req);
if (ret) if (ret)
goto err; goto unmap_ctx;
ret = -EINPROGRESS; ret = -EINPROGRESS;
state->update = ahash_update_ctx; state->update = ahash_update_ctx;
...@@ -1388,8 +1385,7 @@ static int ahash_update_no_ctx(struct ahash_request *req) ...@@ -1388,8 +1385,7 @@ static int ahash_update_no_ctx(struct ahash_request *req)
#endif #endif
return ret; return ret;
unmap_ctx:
err:
ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_TO_DEVICE); ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_TO_DEVICE);
kfree(edesc); kfree(edesc);
return ret; return ret;
...@@ -1548,7 +1544,7 @@ static int ahash_update_first(struct ahash_request *req) ...@@ -1548,7 +1544,7 @@ static int ahash_update_first(struct ahash_request *req)
ret = ahash_edesc_add_src(ctx, edesc, req, mapped_nents, 0, 0, ret = ahash_edesc_add_src(ctx, edesc, req, mapped_nents, 0, 0,
to_hash); to_hash);
if (ret) if (ret)
goto err; goto unmap_ctx;
if (*next_buflen) if (*next_buflen)
scatterwalk_map_and_copy(next_buf, req->src, to_hash, scatterwalk_map_and_copy(next_buf, req->src, to_hash,
...@@ -1558,7 +1554,7 @@ static int ahash_update_first(struct ahash_request *req) ...@@ -1558,7 +1554,7 @@ static int ahash_update_first(struct ahash_request *req)
ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len); ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
if (ret) if (ret)
goto err; goto unmap_ctx;
#ifdef DEBUG #ifdef DEBUG
print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ", print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ",
...@@ -1568,7 +1564,7 @@ static int ahash_update_first(struct ahash_request *req) ...@@ -1568,7 +1564,7 @@ static int ahash_update_first(struct ahash_request *req)
ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_dst, req); ret = caam_jr_enqueue(jrdev, desc, ahash_done_ctx_dst, req);
if (ret) if (ret)
goto err; goto unmap_ctx;
ret = -EINPROGRESS; ret = -EINPROGRESS;
state->update = ahash_update_ctx; state->update = ahash_update_ctx;
...@@ -1588,8 +1584,7 @@ static int ahash_update_first(struct ahash_request *req) ...@@ -1588,8 +1584,7 @@ static int ahash_update_first(struct ahash_request *req)
#endif #endif
return ret; return ret;
unmap_ctx:
err:
ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_TO_DEVICE); ahash_unmap_ctx(jrdev, edesc, req, ctx->ctx_len, DMA_TO_DEVICE);
kfree(edesc); kfree(edesc);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment