Commit 633e507f authored by Longfang Liu's avatar Longfang Liu Committed by Herbert Xu

crypto: hisilicon - fixes some coding style

Clean up extra blank lines
Signed-off-by: default avatarLongfang Liu <liulongfang@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e68f9cf6
......@@ -101,6 +101,7 @@ static int sec_alloc_req_id(struct sec_req *req, struct sec_qp_ctx *qp_ctx)
req->qp_ctx = qp_ctx;
qp_ctx->req_list[req_id] = req;
return req_id;
}
......@@ -317,6 +318,7 @@ static int sec_alloc_pbuf_resource(struct device *dev, struct sec_alg_res *res)
j * SEC_PBUF_PKG + pbuf_page_offset;
}
}
return 0;
}
......@@ -345,12 +347,12 @@ static int sec_alg_resource_alloc(struct sec_ctx *ctx,
}
return 0;
alloc_pbuf_fail:
if (ctx->alg_type == SEC_AEAD)
sec_free_mac_resource(dev, qp_ctx->res);
alloc_fail:
sec_free_civ_resource(dev, res);
return ret;
}
......@@ -419,7 +421,6 @@ static int sec_create_qp_ctx(struct hisi_qm *qm, struct sec_ctx *ctx,
hisi_acc_free_sgl_pool(dev, qp_ctx->c_in_pool);
err_destroy_idr:
idr_destroy(&qp_ctx->req_idr);
return ret;
}
......@@ -557,9 +558,9 @@ static int sec_skcipher_init(struct crypto_skcipher *tfm)
goto err_cipher_init;
return 0;
err_cipher_init:
sec_ctx_base_uninit(ctx);
return ret;
}
......@@ -740,7 +741,6 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,
if (unlikely(pbuf_length != copy_size))
dev_err(dev, "copy pbuf data to dst error!\n");
}
static int sec_cipher_map(struct sec_ctx *ctx, struct sec_req *req,
......@@ -913,9 +913,9 @@ static int sec_aead_setkey(struct crypto_aead *tfm, const u8 *key,
}
return 0;
bad_key:
memzero_explicit(&keys, sizeof(struct crypto_authenc_keys));
return -EINVAL;
}
......@@ -966,7 +966,6 @@ static int sec_request_transfer(struct sec_ctx *ctx, struct sec_req *req)
unmap_req_buf:
ctx->req_op->buf_unmap(ctx, req);
return ret;
}
......@@ -1107,7 +1106,6 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req,
atomic64_inc(&ctx->sec->debug.dfx.recv_busy_cnt);
}
sk_req->base.complete(&sk_req->base, err);
}
......@@ -1279,7 +1277,6 @@ static int sec_process(struct sec_ctx *ctx, struct sec_req *req)
sec_request_untransfer(ctx, req);
err_uninit_req:
sec_request_uninit(ctx, req);
return ret;
}
......@@ -1349,7 +1346,6 @@ static int sec_aead_init(struct crypto_aead *tfm)
sec_auth_uninit(ctx);
err_auth_init:
sec_ctx_base_uninit(ctx);
return ret;
}
......@@ -1437,8 +1433,8 @@ static int sec_skcipher_param_check(struct sec_ctx *ctx, struct sec_req *sreq)
}
return 0;
}
dev_err(dev, "skcipher algorithm error!\n");
return -EINVAL;
}
......@@ -1554,7 +1550,6 @@ static int sec_aead_param_check(struct sec_ctx *ctx, struct sec_req *sreq)
if (unlikely(c_alg != SEC_CALG_AES)) {
dev_err(SEC_CTX_DEV(ctx), "aead crypto alg error!\n");
return -EINVAL;
}
if (sreq->c_req.encrypt)
sreq->c_req.c_len = req->cryptlen;
......
......@@ -660,12 +660,10 @@ static int sec_debugfs_init(struct hisi_qm *qm)
if (ret)
goto failed_to_create;
return 0;
failed_to_create:
debugfs_remove_recursive(sec_debugfs_root);
return ret;
}
......@@ -899,17 +897,13 @@ static int sec_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err_alg_unregister:
hisi_qm_alg_unregister(qm, &sec_devices);
err_qm_stop:
sec_debugfs_exit(qm);
hisi_qm_stop(qm, QM_NORMAL);
err_probe_uninit:
sec_probe_uninit(qm);
err_qm_uninit:
sec_qm_uninit(qm);
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