[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ad9d0a8-00b6-4970-9127-ccbe1d2f26bf@grimberg.me>
Date: Mon, 15 Jan 2024 14:51:39 +0200
From: Sagi Grimberg <sagi@...mberg.me>
To: mengfanhui <mengfanhui@...inos.cn>, kbusch@...nel.org, axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org
Subject: Re: [PATCH] nvme/auth: optimize code redundancy and provide code
quality
> Improve code quality. Reduce code redundancy.
Why does this improve code quality? Why does this
reduce code redundancy?
It's just a different style, seems like a useless change to me.
>
> Signed-off-by: mengfanhui <mengfanhui@...inos.cn>
> ---
> drivers/nvme/common/auth.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/nvme/common/auth.c b/drivers/nvme/common/auth.c
> index a23ab5c968b9..4f9d06afdc38 100644
> --- a/drivers/nvme/common/auth.c
> +++ b/drivers/nvme/common/auth.c
> @@ -250,9 +250,7 @@ struct nvme_dhchap_key *nvme_auth_transform_key(
> if (key->hash == 0) {
> key_len = nvme_auth_key_struct_size(key->len);
> transformed_key = kmemdup(key, key_len, GFP_KERNEL);
> - if (!transformed_key)
> - return ERR_PTR(-ENOMEM);
> - return transformed_key;
> + return transformed_key ? transformed_key : ERR_PTR(-ENOMEM);
> }
> hmac_name = nvme_auth_hmac_name(key->hash);
> if (!hmac_name) {
>
> base-commit: c29901006179c4c87f9335771e50814ec5707239
Powered by blists - more mailing lists