* [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree
@ 2021-01-12 9:21 Bean Huo
2021-01-13 5:30 ` Martin K. Petersen
2021-01-15 4:08 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Bean Huo @ 2021-01-12 9:21 UTC (permalink / raw)
To: alim.akhtar, avri.altman, john.garry, jejb, martin.petersen,
ebiggers, satyat, shipujin.t
Cc: linux-scsi, linux-kernel, Bean Huo
From: Bean Huo <beanhuo@micron.com>
The memory allocated with devm_kzalloc() is freed automatically
no need to explicitly call devm_kfree, so delete it and save some
instruction cycles.
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
Nothing changed in this patch, just drop one patch from the patchset:
https://patchwork.kernel.org/project/linux-scsi/cover/20210111231058.14559-1-huobean@gmail.com/
---
drivers/scsi/ufs/ufshcd-crypto.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c
index 07310b12a5dc..ec80ec83cf85 100644
--- a/drivers/scsi/ufs/ufshcd-crypto.c
+++ b/drivers/scsi/ufs/ufshcd-crypto.c
@@ -182,7 +182,7 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
err = blk_ksm_init(&hba->ksm,
hba->crypto_capabilities.config_count + 1);
if (err)
- goto out_free_caps;
+ goto out;
hba->ksm.ksm_ll_ops = ufshcd_ksm_ops;
/* UFS only supports 8 bytes for any DUN */
@@ -208,8 +208,6 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
return 0;
-out_free_caps:
- devm_kfree(hba->dev, hba->crypto_cap_array);
out:
/* Indicate that init failed by clearing UFSHCD_CAP_CRYPTO */
hba->caps &= ~UFSHCD_CAP_CRYPTO;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree
2021-01-12 9:21 [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree Bean Huo
@ 2021-01-13 5:30 ` Martin K. Petersen
2021-01-15 4:08 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-01-13 5:30 UTC (permalink / raw)
To: Bean Huo
Cc: alim.akhtar, avri.altman, john.garry, jejb, martin.petersen,
ebiggers, satyat, shipujin.t, linux-scsi, linux-kernel, Bean Huo
Bean,
> The memory allocated with devm_kzalloc() is freed automatically no
> need to explicitly call devm_kfree, so delete it and save some
> instruction cycles.
Applied to 5.12/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree
2021-01-12 9:21 [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree Bean Huo
2021-01-13 5:30 ` Martin K. Petersen
@ 2021-01-15 4:08 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-01-15 4:08 UTC (permalink / raw)
To: ebiggers, alim.akhtar, jejb, shipujin.t, Bean Huo, avri.altman,
satyat, john.garry
Cc: Martin K . Petersen, linux-scsi, Bean Huo, linux-kernel
On Tue, 12 Jan 2021 10:21:28 +0100, Bean Huo wrote:
> The memory allocated with devm_kzalloc() is freed automatically
> no need to explicitly call devm_kfree, so delete it and save some
> instruction cycles.
Applied to 5.12/scsi-queue, thanks!
[1/1] scsi: ufs: Remove unnecessary devm_kfree
https://git.kernel.org/mkp/scsi/c/b64750a1b65a
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-15 4:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 9:21 [PATCH v3] scsi: ufs: Remove unnecessary devm_kfree Bean Huo
2021-01-13 5:30 ` Martin K. Petersen
2021-01-15 4:08 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).