md/raid10: Fix a recently introduced sparse warning
PATCH 1/1 md/raid10: Fix a recently introduced sparse warning
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.
--- drivers/md/raid10.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/md/raid10.c +4 -5
@@ -2639,7 +2639,7 @@ static void check_decay_read_errors(struct mddev *mddev, struct md_rdev *rdev) }static int r10_sync_page_io (struct md_rdev *rdev,sector_t sector, -int sectors,struct page *page,int rw) +int sectors,struct page *page,enum req_op op) {sector_t first_bad;int bad_sectors;
@@ -2647,7 +2647,7 @@ static int r10_sync_page_io(struct md_rdev *rdev, sector_t sector,if (is_badblock (rdev, sector, sectors, &first_bad, &bad_sectors) && (rw ==READ ||test_bit (WriteErrorSeen, &rdev->flags)))return -1 ; -if (sync_page_io (rdev, sector, sectors <<9 , page, rw, false)) +if (sync_page_io (rdev, sector, sectors <<9 , page, op, false))/* success */ return 1 ;if (rw ==WRITE ) {
@@ -2780,7 +2780,7 @@ static void fix_read_error(struct r10conf *conf, struct mddev *mddev, struct r10if (r10_sync_page_io (rdev, r10_bio->devs[sl].addr + sect, - s, conf->tmppage,WRITE ) + s, conf->tmppage,REQ_OP_WRITE ) ==0 ) {/* Well, this device is dead */ 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 r10switch (r10_sync_page_io (rdev, r10_bio->devs[sl].addr + sect, - s, conf->tmppage, -READ )) { + s, conf->tmppage,REQ_OP_READ )) {case 0 :/* Well, this device is dead */ pr_notice("md/raid10:%s: unable to read back corrected sectors (%d sectors at %llu on %pg)\n",
Dear Bart,
Thank you for the patch. I’d prefer the commit message summary to be specific about the change, as there are several sparse warnings. Maybe:
Quoted 1 line
Update
r10_sync_page_io()to takereq_opover int
Otherwise, this looks good to me.
Kind regards,
Paul
Quoted 5 lines · Paul Menzel
Thank you for the patch. I’d prefer the commit message summary to be specific about the change, as there are several sparse warnings. Maybe:
Quoted 1 line
Update
r10_sync_page_io()to takereq_opover intOtherwise, this looks good to me.
Hi Paul,
Thanks for having taken a look. I will make the patch subject more specific and repost this patch.
Bart.