Skip to contentSkip to conversation

drivers/scsi: remove dead code

PATCH Applied Ariel Otilibili 2 participants 8 messages Dec 13, 2024 – Jan 10, 2025

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 drivers/scsi: remove dead code

* reported by Coverity ID 1602240
* ldev_info is always true, therefore the branch statement is never called.

Fixes 081ff398c56cc ("scsi: myrb: Add Mylex RAID controller (block interface)")
Cc Hannes Reinecke <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
---
 drivers/scsi/myrb.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/myrb.c +0 -2
index 363d71189cfe..dc4bd422b601 100644
@@ -1627,8 +1627,6 @@ static int myrb_ldev_sdev_init(struct scsi_device *sdev)
 	enum raid_level level;
 
 	ldev_info = cb->ldev_info_buf + ldev_num;
-	if (!ldev_info)
-		return -ENXIO;
 
 	sdev->hostdata = kzalloc(sizeof(*ldev_info), GFP_KERNEL);
 	if (!sdev->hostdata)
Signature · 1 line
2.47.1
#2 lore raw

Hello,

Is there any news of the patch? Your feedback is much appreciated.

Have a good day,
Ariel

Quoted 28 lines · Ariel Otilibili

* reported by Coverity ID 1602240
* ldev_info is always true, therefore the branch statement is never called.

Fixes 081ff398c56cc ("scsi: myrb: Add Mylex RAID controller (block interface)")
Cc Hannes Reinecke <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
Cc "Martin K. Petersen" <[email protected]>
---
 drivers/scsi/myrb.c | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/myrb.c +0 -2
index 363d71189cfe..dc4bd422b601 100644
@@ -1627,8 +1627,6 @@ static int myrb_ldev_sdev_init(struct scsi_device *sdev)
 	enum raid_level level;
 
 	ldev_info = cb->ldev_info_buf + ldev_num;
-	if (!ldev_info)
-		return -ENXIO;
 
 	sdev->hostdata = kzalloc(sizeof(*ldev_info), GFP_KERNEL);
 	if (!sdev->hostdata)
Signature · 1 line
2.47.1
#3 lore raw
In reply to Ariel Otilibili

Hi Ariel,

Quoted 4 lines

* reported by Coverity ID 1602240
* ldev_info is always true, therefore the branch statement is never called.

Fixes 081ff398c56cc ("scsi: myrb: Add Mylex RAID controller (block interface)")

Per the Fixes line above: The correct tag for this driver is "scsi:
myrb:" and not "drivers/scsi:". I fixed it up.

Applied to 6.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
Quoted 5 lines · Martin K. Petersen

Per the Fixes line above: The correct tag for this driver is "scsi:
myrb:" and not "drivers/scsi:". I fixed it up.

Applied to 6.14/scsi-staging, thanks!

Hi Martin, that is awesome. Thanks for handling the patch!

Were you referring to this tree? The commit hasn’t appeared yet.

https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/log/?h=6.14/scsi-staging

Best regards, and happy new year,
Ariel

Quoted 3 lines
Signature · 2 lines
-- 
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw

Ariel,

Quoted 1 line

Were you referring to this tree? The commit hasn’t appeared yet.

It's there now.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#6 lore raw
Quoted 6 lines · Martin K. Petersen

Ariel,

Quoted 1 line

Were you referring to this tree? The commit hasn’t appeared yet.

It's there now.

Indeed. Thanks, Martin;
Have a good one.

Quoted 3 lines
Signature · 2 lines
-- 
Martin K. Petersen	Oracle Linux Engineering