Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89f78b32 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: move rq->errors quirk out from ide_end_request()



Move rq->errors quirk out from ide_end_request() to its call sites.

There should be no functional changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 6902a533
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -405,8 +405,13 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
		if (blk_special_request(rq)) {
			rq->errors = 0;
			ide_complete_rq(drive, 0);
		} else
		} else {
			if (blk_fs_request(rq) == 0 && uptodate <= 0) {
				if (rq->errors == 0)
					rq->errors = -EIO;
			}
			ide_end_request(drive, uptodate, 0);
		}

		return ide_stopped;
	}
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,9 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate)
	ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d",
				    uptodate, nsectors);

	if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0)
		rq->errors = -EIO;

	ide_end_request(drive, uptodate, nsectors);
}

+2 −0
Original line number Diff line number Diff line
@@ -184,6 +184,8 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq,

	if (!blk_fs_request(rq)) {
		blk_dump_rq_flags(rq, "ide_do_rw_disk - bad command");
		if (rq->errors == 0)
			rq->errors = -EIO;
		ide_end_request(drive, 0, 0);
		return ide_stopped;
	}
+4 −1
Original line number Diff line number Diff line
@@ -146,9 +146,12 @@ static inline void ide_complete_drive_reset(ide_drive_t *drive, int err)
{
	struct request *rq = drive->hwif->rq;

	if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET)
	if (rq && blk_special_request(rq) && rq->cmd[0] == REQ_DRIVE_RESET) {
		if (err <= 0 && rq->errors == 0)
			rq->errors = -EIO;
		ide_end_request(drive, err ? err : 1, 0);
	}
}

/* needed below */
static ide_startstop_t do_reset1(ide_drive_t *, int);
+2 −0
Original line number Diff line number Diff line
@@ -298,6 +298,8 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
	return idefloppy_issue_pc(drive, pc);
out_end:
	drive->failed_pc = NULL;
	if (blk_fs_request(rq) == 0 && rq->errors == 0)
		rq->errors = -EIO;
	ide_end_request(drive, 0, 0);
	return ide_stopped;
}
Loading