mbox series

[v3,0/2] crypto:hisilicon/sec - fixes some coding style

Message ID 1614838735-52668-1-git-send-email-liulongfang@huawei.com
Headers show
Series crypto:hisilicon/sec - fixes some coding style | expand

Message

liulongfang March 4, 2021, 6:18 a.m. UTC
1. Fix a problems.
2. Fix some coding style.

Changes v2 -> v3:
  - Delete shash test error patch.

Changes v1 -> v2:
  - Modify the way to fix shash test error.

Longfang Liu (2):
  crypto: hisilicon/sec - fixes some log printing style
  crypto: hisilicon/sec - fixes some driver coding style

 drivers/crypto/hisilicon/sec2/sec.h        |   5 +-
 drivers/crypto/hisilicon/sec2/sec_crypto.c |  82 +++++++++---------
 drivers/crypto/hisilicon/sec2/sec_crypto.h |   2 -
 drivers/crypto/hisilicon/sec2/sec_main.c   | 131 +++++++++++++++++------------
 4 files changed, 118 insertions(+), 102 deletions(-)

Comments

Herbert Xu March 12, 2021, 12:59 p.m. UTC | #1
On Thu, Mar 04, 2021 at 02:18:54PM +0800, Longfang Liu wrote:
>

> @@ -727,7 +725,7 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,

>  	struct aead_request *aead_req = req->aead_req.aead_req;

>  	struct sec_cipher_req *c_req = &req->c_req;

>  	struct sec_qp_ctx *qp_ctx = req->qp_ctx;

> -	struct device *dev = SEC_CTX_DEV(ctx);

> +	struct device *dev = ctx->dev;

>  	int copy_size, pbuf_length;

>  	int req_id = req->req_id;

>  

> @@ -737,11 +735,9 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,

>  		copy_size = c_req->c_len;

>  

>  	pbuf_length = sg_copy_from_buffer(dst, sg_nents(dst),

> -				qp_ctx->res[req_id].pbuf,

> -				copy_size);

> -

> +			qp_ctx->res[req_id].pbuf, copy_size);

>  	if (unlikely(pbuf_length != copy_size))

> -		dev_err(dev, "copy pbuf data to dst error!\n");

> +		dev_err(ctx->dev, "copy pbuf data to dst error!\n");

>  }


This triggers an unused warning on dev.  Please fix.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
liulongfang March 13, 2021, 1:30 a.m. UTC | #2
On 2021/3/12 20:59, Herbert Xu wrote:
> On Thu, Mar 04, 2021 at 02:18:54PM +0800, Longfang Liu wrote:

>>

>> @@ -727,7 +725,7 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,

>>  	struct aead_request *aead_req = req->aead_req.aead_req;

>>  	struct sec_cipher_req *c_req = &req->c_req;

>>  	struct sec_qp_ctx *qp_ctx = req->qp_ctx;

>> -	struct device *dev = SEC_CTX_DEV(ctx);

>> +	struct device *dev = ctx->dev;

>>  	int copy_size, pbuf_length;

>>  	int req_id = req->req_id;

>>  

>> @@ -737,11 +735,9 @@ static void sec_cipher_pbuf_unmap(struct sec_ctx *ctx, struct sec_req *req,

>>  		copy_size = c_req->c_len;

>>  

>>  	pbuf_length = sg_copy_from_buffer(dst, sg_nents(dst),

>> -				qp_ctx->res[req_id].pbuf,

>> -				copy_size);

>> -

>> +			qp_ctx->res[req_id].pbuf, copy_size);

>>  	if (unlikely(pbuf_length != copy_size))

>> -		dev_err(dev, "copy pbuf data to dst error!\n");

>> +		dev_err(ctx->dev, "copy pbuf data to dst error!\n");

>>  }

> 

> This triggers an unused warning on dev.  Please fix.

> 

> Thanks,

> Ok! I will check if this problem exists elsewhere.

Thanks,
Longfang