scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
Subsystems (3)
PATCH 1/1 scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
The "head" pointer can't be NULL because it points to an address in the middle of a ufs_hba struct. Looking at this code, probably someone would wonder if the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed.
--- drivers/scsi/ufs/ufs-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufs-exynos.c +1 -1
@@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)u8 div =0 ;int ret =0 ; -if (!head ||list_empty (head)) +if (list_empty (head)) goto out;list_for_each_entry (clki, head, list) {
Signature · 1 line
2.27.0
Hi Dan
Quoted 2 lines
-----Original Message-----
The "head" pointer can't be NULL because it points to an address in the
middle
Quoted 1 line
of a
ufs_hbastruct. Looking at this code, probably someone would wonder
if
Quoted 5 lines
the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed.
Signed-off-by Dan Carpenter <[email protected]>---
Please add Fixes: tag
With that
Thanks!
drivers/scsi/ufs/ufs-exynos.c
Quoted 4 lines
drivers/scsi/ufs/ufs-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/ufs/ufs-exynos.c +0
-0
index
Quoted 15 lines
16544b3dad47..802f7de626e8100644drivers/scsi/ufs/ufs-exynos.c +1
-1@@ -264,7 +264,7 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)u8 div =0 ;int ret =0 ; -if (!head ||list_empty (head)) +if (list_empty (head)) goto out;
list_for_each_entry(clki, head, list){
--
2.27.0
Quoted 7 lines · Alim Akhtar
Hi Dan
Quoted 2 lines
-----Original Message-----
The "head" pointer can't be NULL because it points to an address in themiddle
Quoted 1 line
of a
ufs_hbastruct. Looking at this code, probably someone would wonderif
Quoted 8 lines
Quoted 5 lines
the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed.
Signed-off-by Dan Carpenter <[email protected]>---
Please add Fixes: tag
With thatAcked-by Alim Akhtar <[email protected]>
It's not a bug fix it's just a cleanup.
regards,
dan carpenter
Hi Dan,
Quoted 7 lines
-----Original Message-----
From: Dan Carpenter <[email protected]>Quoted 4 lines · Alim Akhtar
Hi Dan
Quoted 2 lines
-----Original Message-----
The "head" pointer can't be NULL because it points to an address in
the
Quoted 2 lines
Quoted 2 lines
middle
Quoted 1 line
of a
ufs_hbastruct. Looking at this code, probably someone would
wonder
Quoted 4 lines
Quoted 4 lines
if
Quoted 3 lines
the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Dan Carpenter <[email protected]>---
Please add Fixes: tag
With thatAcked-by Alim Akhtar <[email protected]>It's not a bug fix it's just a cleanup.
Thanks!
Quoted 2 lines
regards,
dan carpenter
Martin K. Petersen
AppliedQuoted 4 lines · Dan Carpenter
The "head" pointer can't be NULL because it points to an address in the middle of a
ufs_hbastruct. Looking at this code, probably someone would wonder if the intent was to check whether "hba" is NULL, but "hba" isn't NULL and the check can just be removed.
Applied to 5.9/scsi-queue, thanks!
[1/1] scsi: ufs: ufs-exynos: Remove an unnecessary NULL check
https://git.kernel.org/mkp/scsi/c/b7a80dac0f1f
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering