* [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check
@ 2022-05-23 8:28 Dan Carpenter
2022-05-24 3:14 ` Martin K. Petersen
2022-05-24 18:11 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-05-23 8:28 UTC (permalink / raw)
To: Alim Akhtar
Cc: Avri Altman, Bart Van Assche, James E.J. Bottomley,
Martin K. Petersen, Bean Huo, Daejun Park, Adrian Hunter,
linux-scsi, kernel-janitors
The "info" pointer points to somewhere in the middle of the "hba" struct.
It can't possibly be NULL. Delete the NULL check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/ufs/core/ufshcd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index efe67a381c32..01fb4bad86be 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8445,10 +8445,7 @@ static int ufshcd_init_hba_vreg(struct ufs_hba *hba)
{
struct ufs_vreg_info *info = &hba->vreg_info;
- if (info)
- return ufshcd_get_vreg(hba->dev, info->vdd_hba);
-
- return 0;
+ return ufshcd_get_vreg(hba->dev, info->vdd_hba);
}
static int ufshcd_setup_clocks(struct ufs_hba *hba, bool on)
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check
2022-05-23 8:28 [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check Dan Carpenter
@ 2022-05-24 3:14 ` Martin K. Petersen
2022-05-24 18:11 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-24 3:14 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alim Akhtar, Avri Altman, Bart Van Assche, James E.J. Bottomley,
Martin K. Petersen, Bean Huo, Daejun Park, Adrian Hunter,
linux-scsi, kernel-janitors
Dan,
> The "info" pointer points to somewhere in the middle of the "hba"
> struct. It can't possibly be NULL. Delete the NULL check.
Applied to 5.19/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check
2022-05-23 8:28 [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check Dan Carpenter
2022-05-24 3:14 ` Martin K. Petersen
@ 2022-05-24 18:11 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-24 18:11 UTC (permalink / raw)
To: Alim Akhtar, Dan Carpenter
Cc: Martin K . Petersen, linux-scsi, James E.J. Bottomley,
Avri Altman, Adrian Hunter, Bean Huo, Daejun Park,
Bart Van Assche, kernel-janitors
On Mon, 23 May 2022 11:28:18 +0300, Dan Carpenter wrote:
> The "info" pointer points to somewhere in the middle of the "hba" struct.
> It can't possibly be NULL. Delete the NULL check.
>
>
Applied to 5.19/scsi-queue, thanks!
[1/1] scsi: ufs: ufshcd: delete unnecessary NULL check
https://git.kernel.org/mkp/scsi/c/476e45923b5d
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-24 18:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 8:28 [PATCH] scsi: ufs: ufshcd: delete unnecessary NULL check Dan Carpenter
2022-05-24 3:14 ` Martin K. Petersen
2022-05-24 18:11 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.