From fcabd2f0bc31dca6dbacb380cd562087d514a6fc Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sun, 9 Mar 2008 13:44:32 +0900 Subject: [PATCH] --- yaml --- r: 89677 b: refs/heads/master c: 1a7a2e1a77f29179f997ca5e873c50ae2fb7fcc1 h: refs/heads/master i: 89675: 597670555f6422de25146d38f312c0583f75d413 v: v3 --- [refs] | 2 +- trunk/arch/ia64/hp/sim/simscsi.c | 23 ++++------------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index af3657587ee0..f5f57f940632 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 944cf8b4cba42fcb284a29e4817831471adb4fad +refs/heads/master: 1a7a2e1a77f29179f997ca5e873c50ae2fb7fcc1 diff --git a/trunk/arch/ia64/hp/sim/simscsi.c b/trunk/arch/ia64/hp/sim/simscsi.c index 7661bb065fa5..3a078ad3aa44 100644 --- a/trunk/arch/ia64/hp/sim/simscsi.c +++ b/trunk/arch/ia64/hp/sim/simscsi.c @@ -201,22 +201,6 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) simscsi_sg_readwrite(sc, mode, offset); } -static void simscsi_fillresult(struct scsi_cmnd *sc, char *buf, unsigned len) -{ - - int i; - unsigned thislen; - struct scatterlist *slp; - - scsi_for_each_sg(sc, slp, scsi_sg_count(sc), i) { - if (!len) - break; - thislen = min(len, slp->length); - memcpy(sg_virt(slp), buf, thislen); - len -= thislen; - } -} - static int simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) { @@ -258,7 +242,7 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) buf[6] = 0; /* reserved */ buf[7] = 0; /* various flags */ memcpy(buf + 8, "HP SIMULATED DISK 0.00", 28); - simscsi_fillresult(sc, buf, 36); + scsi_sg_copy_from_buffer(sc, buf, 36); sc->result = GOOD; break; @@ -306,14 +290,15 @@ simscsi_queuecommand (struct scsi_cmnd *sc, void (*done)(struct scsi_cmnd *)) buf[5] = 0; buf[6] = 2; buf[7] = 0; - simscsi_fillresult(sc, buf, 8); + scsi_sg_copy_from_buffer(sc, buf, 8); sc->result = GOOD; break; case MODE_SENSE: case MODE_SENSE_10: /* sd.c uses this to determine whether disk does write-caching. */ - simscsi_fillresult(sc, (char *)empty_zero_page, scsi_bufflen(sc)); + scsi_sg_copy_from_buffer(sc, (char *)empty_zero_page, + PAGE_SIZE); sc->result = GOOD; break;