Skip to contentSkip to conversation

scsi: remove unnecessary unlikely()

PATCH Applied Igor Stoppa 2 participants 2 messages Sep 5, 2018 – Sep 17, 2018 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: remove unnecessary unlikely()

BUG_ON() already contains an unlikely(), there is no need for another one.

Cc "Martin K. Petersen" <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
---
 drivers/scsi/scsi_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_lib.c +2 -2
index 0adfb3bce0fd..aaa1819b0a69 100644
@@ -1207,8 +1207,8 @@ int scsi_init_io(struct scsi_cmnd *cmd)
 
 		count = blk_rq_map_integrity_sg(rq->q, rq->bio,
 						prot_sdb->table.sgl);
-		BUG_ON(unlikely(count > ivecs));
-		BUG_ON(unlikely(count > queue_max_integrity_segments(rq->q)));
+		BUG_ON(count > ivecs);
+		BUG_ON(count > queue_max_integrity_segments(rq->q));
 
 		cmd->prot_sdb = prot_sdb;
 		cmd->prot_sdb->table.nents = count;
Signature · 1 line
2.17.1
#1 lore raw

Igor,

Quoted 1 line

BUG_ON() already contains an unlikely(), there is no need for another one.

Applied to 4.20/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering