* [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
[not found] <CGME20260529061727epcas1p495c499c91420790a225e66263f3fff52@epcas1p4.samsung.com>
@ 2026-05-29 6:16 ` Chanwoo Lee
2026-05-29 9:08 ` Peter Wang (王信友)
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Chanwoo Lee @ 2026-05-29 6:16 UTC (permalink / raw)
To: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
Martin K. Petersen, Peter Wang, Bean Huo, Can Guo, Adrian Hunter,
open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER,
open list
Cc: Chanwoo Lee
ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
calling vops wrappers, but the wrappers already do NULL check
internally. Remove the redundant checks. Also remove
ufshcd_variant_hba_exit() entirely since it only wraps
ufshcd_vops_exit() with no added value.
Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
---
drivers/ufs/core/ufshcd.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 7481c71c71b8..1f914d095adb 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9870,28 +9870,15 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
static int ufshcd_variant_hba_init(struct ufs_hba *hba)
{
- int err = 0;
-
- if (!hba->vops)
- goto out;
+ int err = ufshcd_vops_init(hba);
- err = ufshcd_vops_init(hba);
if (err)
dev_err_probe(hba->dev, err,
"%s: variant %s init failed with err %d\n",
__func__, ufshcd_get_var_name(hba), err);
-out:
return err;
}
-static void ufshcd_variant_hba_exit(struct ufs_hba *hba)
-{
- if (!hba->vops)
- return;
-
- ufshcd_vops_exit(hba);
-}
-
static int ufshcd_hba_init(struct ufs_hba *hba)
{
int err;
@@ -9959,7 +9946,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
if (hba->eh_wq)
destroy_workqueue(hba->eh_wq);
ufs_debugfs_hba_exit(hba);
- ufshcd_variant_hba_exit(hba);
+ ufshcd_vops_exit(hba);
ufshcd_setup_vreg(hba, false);
ufshcd_setup_clocks(hba, false);
ufshcd_setup_hba_vreg(hba, false);
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
2026-05-29 6:16 ` [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper Chanwoo Lee
@ 2026-05-29 9:08 ` Peter Wang (王信友)
2026-05-29 17:36 ` Bart Van Assche
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Peter Wang (王信友) @ 2026-05-29 9:08 UTC (permalink / raw)
To: beanhuo, avri.altman, cw9316.lee, linux-scsi, bvanassche,
linux-kernel, alim.akhtar, adrian.hunter, martin.petersen,
James.Bottomley, can.guo
On Fri, 2026-05-29 at 15:16 +0900, Chanwoo Lee wrote:
> ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
> calling vops wrappers, but the wrappers already do NULL check
> internally. Remove the redundant checks. Also remove
> ufshcd_variant_hba_exit() entirely since it only wraps
> ufshcd_vops_exit() with no added value.
>
> Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
> ---
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
2026-05-29 6:16 ` [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper Chanwoo Lee
2026-05-29 9:08 ` Peter Wang (王信友)
@ 2026-05-29 17:36 ` Bart Van Assche
2026-06-02 2:02 ` Martin K. Petersen
2026-06-09 1:38 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2026-05-29 17:36 UTC (permalink / raw)
To: Chanwoo Lee, Alim Akhtar, Avri Altman, James E.J. Bottomley,
Martin K. Petersen, Peter Wang, Bean Huo, Can Guo, Adrian Hunter,
open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER,
open list
On 5/28/26 11:16 PM, Chanwoo Lee wrote:
> ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
> calling vops wrappers, but the wrappers already do NULL check
> internally. Remove the redundant checks. Also remove
> ufshcd_variant_hba_exit() entirely since it only wraps
> ufshcd_vops_exit() with no added value.
For future patches, please stick to the "one change per patch" rule.
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
2026-05-29 6:16 ` [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper Chanwoo Lee
2026-05-29 9:08 ` Peter Wang (王信友)
2026-05-29 17:36 ` Bart Van Assche
@ 2026-06-02 2:02 ` Martin K. Petersen
2026-06-09 1:38 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2026-06-02 2:02 UTC (permalink / raw)
To: Chanwoo Lee
Cc: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
Martin K. Petersen, Peter Wang, Bean Huo, Can Guo, Adrian Hunter,
open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER,
open list
Chanwoo,
> ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
> calling vops wrappers, but the wrappers already do NULL check
> internally. Remove the redundant checks. Also remove
> ufshcd_variant_hba_exit() entirely since it only wraps
> ufshcd_vops_exit() with no added value.
Applied to 7.2/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
2026-05-29 6:16 ` [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper Chanwoo Lee
` (2 preceding siblings ...)
2026-06-02 2:02 ` Martin K. Petersen
@ 2026-06-09 1:38 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2026-06-09 1:38 UTC (permalink / raw)
To: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
Peter Wang, Bean Huo, Can Guo, Adrian Hunter, linux-scsi,
linux-kernel, Chanwoo Lee
Cc: Martin K . Petersen
On Fri, 29 May 2026 15:16:19 +0900, Chanwoo Lee wrote:
> ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
> calling vops wrappers, but the wrappers already do NULL check
> internally. Remove the redundant checks. Also remove
> ufshcd_variant_hba_exit() entirely since it only wraps
> ufshcd_vops_exit() with no added value.
>
>
> [...]
Applied to 7.2/scsi-queue, thanks!
[1/1] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
https://git.kernel.org/mkp/scsi/c/0600eec09ad6
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-09 1:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20260529061727epcas1p495c499c91420790a225e66263f3fff52@epcas1p4.samsung.com>
2026-05-29 6:16 ` [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper Chanwoo Lee
2026-05-29 9:08 ` Peter Wang (王信友)
2026-05-29 17:36 ` Bart Van Assche
2026-06-02 2:02 ` Martin K. Petersen
2026-06-09 1:38 ` 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
all inboxes | Powered by JetHome®