Skip to contentSkip to conversation

drivers/s390/block/dcssblk.c: Fix Unlikely(x) != y

PATCH In review Roel Kluin 2 participants 2 messages Feb 16, 2008 – Feb 17, 2008 s390

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 3/3 drivers/s390/block/dcssblk.c: Fix Unlikely(x) != y

The patch below was not yet tested. If it's correct as it is, please comment.
---
Fix Unlikely(x) != y

---

drivers/s390/block/dcssblk.c +1 -1
index 3faf053..e6c94db 100644
@@ -666,7 +666,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
 		page_addr = (unsigned long)
 			page_address(bvec->bv_page) + bvec->bv_offset;
 		source_addr = dev_info->start + (index<<12) + bytes_done;
-		if (unlikely(page_addr & 4095) != 0 || (bvec->bv_len & 4095) != 0)
+		if (unlikely((page_addr & 4095) != 0) || (bvec->bv_len & 4095) != 0)
 			// More paranoia.
 			goto fail;
 		if (bio_data_dir(bio) == READ) {
#1 lore raw
Quoted 11 lines · Roel Kluin

The patch below was not yet tested. If it's correct as it is, please comment.
---
Fix Unlikely(x) != y

---

drivers/s390/block/dcssblk.c +0 -0
index 3faf053..e6c94db 100644

drivers/s390/block/dcssblk.c dcssblk_make_request(struct request_queue *q, struct bio *bio) · line 672

Quoted 8 lines
drivers/s390/block/dcssblk.c +1 -1
@@ -666,7 +666,7 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
 		page_addr = (unsigned long)
 			page_address(bvec->bv_page) + bvec->bv_offset;
 		source_addr = dev_info->start + (index<<12) + bytes_done;
-		if (unlikely(page_addr & 4095) != 0 || (bvec->bv_len & 4095) != 0)
+		if (unlikely((page_addr & 4095) != 0) || (bvec->bv_len & 4095) != 0)
 			// More paranoia.
 			goto fail;
 		if (bio_data_dir(bio) == READ) {

Your patch is correct, thank you! At least it wasn't a real bug. Will be applied.