[patch] ll_rw_block removed some not necessary check for null

Andrea Arcangeli (andrea@suse.de)
Mon, 9 Aug 1999 01:17:11 +0200 (CEST)


In ll_rw_block() there's some not necessary check for NULL. For the
make_request loop, if such pointers would be NULL they would have Oopsed
in the previous checking-loop. For the "sorry" loop, they may have
previously oopsed in the same checking-loop as well.

Patch against 2.3.13-pre8:

--- 2.3.13-pre8/drivers/block/ll_rw_blk.c Sun Aug 8 17:21:29 1999
+++ /tmp/ll_rw_blk.c Mon Aug 9 01:11:00 1999
@@ -654,26 +654,22 @@
}

for (i = 0; i < nr; i++) {
- if (bh[i]) {
- set_bit(BH_Req, &bh[i]->b_state);
+ set_bit(BH_Req, &bh[i]->b_state);
#ifdef CONFIG_BLK_DEV_MD
- if (MAJOR(bh[i]->b_dev) == MD_MAJOR) {
- md_make_request(MINOR (bh[i]->b_dev), rw, bh[i]);
- continue;
- }
-#endif
- make_request(MAJOR(bh[i]->b_rdev), rw, bh[i]);
+ if (MAJOR(bh[i]->b_dev) == MD_MAJOR) {
+ md_make_request(MINOR (bh[i]->b_dev), rw, bh[i]);
+ continue;
}
+#endif
+ make_request(MAJOR(bh[i]->b_rdev), rw, bh[i]);
}
return;

sorry:
for (i = 0; i < nr; i++) {
- if (bh[i]) {
- clear_bit(BH_Dirty, &bh[i]->b_state);
- clear_bit(BH_Uptodate, &bh[i]->b_state);
- bh[i]->b_end_io(bh[i], 0);
- }
+ clear_bit(BH_Dirty, &bh[i]->b_state);
+ clear_bit(BH_Uptodate, &bh[i]->b_state);
+ bh[i]->b_end_io(bh[i], 0);
}
return;
}

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/