Skip to content

Commit 265ad47

Browse files
bvanasscheliu-song-6
authored andcommitted
md/raid10: Fix the data type of an r10_sync_page_io() argument
Fix the following sparse warning: drivers/md/raid10.c:2647:60: sparse: sparse: incorrect type in argument 5 (different base types) @@ expected restricted blk_opf_t [usertype] opf @@ got int rw @@ This patch does not change any functionality since REQ_OP_READ = READ = 0 and since REQ_OP_WRITE = WRITE = 1. Cc: Rong A Chen <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Paul Menzel <[email protected]> Fixes: 4ce4c73 ("md/core: Combine two sync_page_io() arguments") Reported-by: kernel test robot <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent c490a0b commit 265ad47

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/md/raid10.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,18 +2639,18 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev)
26392639
}
26402640

26412641
static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,
2642-
int sectors, struct page *page, int rw)
2642+
int sectors, struct page *page, enum req_op op)
26432643
{
26442644
sector_t first_bad;
26452645
int bad_sectors;
26462646

26472647
if (is_badblock(rdev, sector, sectors, &first_bad, &bad_sectors)
2648-
&& (rw == READ || test_bit(WriteErrorSeen, &rdev->flags)))
2648+
&& (op == REQ_OP_READ || test_bit(WriteErrorSeen, &rdev->flags)))
26492649
return -1;
2650-
if (sync_page_io(rdev, sector, sectors << 9, page, rw, false))
2650+
if (sync_page_io(rdev, sector, sectors << 9, page, op, false))
26512651
/* success */
26522652
return 1;
2653-
if (rw == WRITE) {
2653+
if (op == REQ_OP_WRITE) {
26542654
set_bit(WriteErrorSeen, &rdev->flags);
26552655
if (!test_and_set_bit(WantReplacement, &rdev->flags))
26562656
set_bit(MD_RECOVERY_NEEDED,
@@ -2780,7 +2780,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
27802780
if (r10_sync_page_io(rdev,
27812781
r10_bio->devs[sl].addr +
27822782
sect,
2783-
s, conf->tmppage, WRITE)
2783+
s, conf->tmppage, REQ_OP_WRITE)
27842784
== 0) {
27852785
/* Well, this device is dead */
27862786
pr_notice("md/raid10:%s: read correction write failed (%d sectors at %llu on %pg)\n",
@@ -2814,8 +2814,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10
28142814
switch (r10_sync_page_io(rdev,
28152815
r10_bio->devs[sl].addr +
28162816
sect,
2817-
s, conf->tmppage,
2818-
READ)) {
2817+
s, conf->tmppage, REQ_OP_READ)) {
28192818
case 0:
28202819
/* Well, this device is dead */
28212820
pr_notice("md/raid10:%s: unable to read back corrected sectors (%d sectors at %llu on %pg)\n",

0 commit comments

Comments
 (0)