2020-09-16 06:24:31

by Qinglang Miao

[permalink] [raw]
Subject: [PATCH -next] crypto: qat - remove unnecessary mutex_init()

The mutex adf_ctl_lock is initialized statically. It is
unnecessary to initialize by mutex_init().

Signed-off-by: Qinglang Miao <[email protected]>
---
drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
index 71d0c44aa..eb9b3be9d 100644
--- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
+++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
@@ -416,8 +416,6 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)

static int __init adf_register_ctl_device_driver(void)
{
- mutex_init(&adf_ctl_lock);
-
if (adf_chr_drv_create())
goto err_chr_dev;

--
2.23.0


2020-09-24 05:04:20

by Cabiddu, Giovanni

[permalink] [raw]
Subject: Re: [PATCH -next] crypto: qat - remove unnecessary mutex_init()

On Wed, Sep 16, 2020 at 07:21:21AM +0100, Qinglang Miao wrote:
> The mutex adf_ctl_lock is initialized statically. It is
> unnecessary to initialize by mutex_init().
>
> Signed-off-by: Qinglang Miao <[email protected]>

Acked-by: Giovanni Cabiddu <[email protected]>

> ---
> drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> index 71d0c44aa..eb9b3be9d 100644
> --- a/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> +++ b/drivers/crypto/qat/qat_common/adf_ctl_drv.c
> @@ -416,8 +416,6 @@ static long adf_ctl_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
>
> static int __init adf_register_ctl_device_driver(void)
> {
> - mutex_init(&adf_ctl_lock);
> -
> if (adf_chr_drv_create())
> goto err_chr_dev;
>
> --
> 2.23.0
>

2020-09-25 08:13:31

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH -next] crypto: qat - remove unnecessary mutex_init()

On Wed, Sep 16, 2020 at 02:21:21PM +0800, Qinglang Miao wrote:
> The mutex adf_ctl_lock is initialized statically. It is
> unnecessary to initialize by mutex_init().
>
> Signed-off-by: Qinglang Miao <[email protected]>
> ---
> drivers/crypto/qat/qat_common/adf_ctl_drv.c | 2 --
> 1 file changed, 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt