iteraid: remove home-grown memmove()
PATCH 3/3 iteraid: remove home-grown memmove()
Signed-off-by Alexey Dobriyan <[email protected]>
---
drivers/scsi/iteraid.c | 46 ++++++---------------------------------------- 1 files changed, 6 insertions(+), 40 deletions(-)
drivers/scsi/iteraid.c +6 -40
@@ -3194,36 +3194,6 @@ static u8 IdeVerify(PChannel pChan, PSCSreturn SRB_STATUS_PENDING ; }/* end IdeVerify */ -/************************************************************************ -* This function is used to copy memory with overlapped destination and -* source. I guess ScsiPortMoveMemory cannot handle this well. Can it? -************************************************************************/ -static void -IT8212MoveMemory (unsigned char *DestAddr,unsigned char *SrcAddr,u32 ByteCount) -{ -long i; - -dprintk ("IT8212MoveMemory: DestAddr=0x%p, SrcAddr=0x%p, " -"ByteCount=0x%x\n" , DestAddr, SrcAddr, ByteCount); -if (DestAddr > SrcAddr) { - -/* -* If Destination Area is in the back of the Source Area, copy -* from the end of the requested area. -*/ -for (i = (ByteCount -1 ); i >=0 ; i--) - *(DestAddr + i) = *(SrcAddr + i); - }else if (DestAddr < SrcAddr) { - -/* -* If Destination Area is in the front of the Source Area, copy -* from the begin of the requested area. -*/ -for (i =0 ; i < ByteCount; i++) - *(DestAddr + i) = *(SrcAddr + i); - } -}/* end IT8212MoveMemory */ -/* * Convert SCSI packet command to Atapi packet command. */
@@ -3349,16 +3319,12 @@ static void Scsi2Atapi(PChannel pChan, Psizeof (SCSI_MODE_PARAMETER_HEADER6 ) -sizeof (SCSI_MODE_PARAMTER_BLOCK_DESCRIPTER );if (byteCount >0 ) { -IT8212MoveMemory ((unsigned char *)header10 + -sizeof - (SCSI_MODE_PARAMETER_HEADER10 ), - (unsigned char *)header10 + -sizeof - (SCSI_MODE_PARAMETER_HEADER6 ) - + -sizeof - (SCSI_MODE_PARAMTER_BLOCK_DESCRIPTER ), - byteCount); +memmove ((unsigned char *)header10 + +sizeof (SCSI_MODE_PARAMETER_HEADER10 ), + (unsigned char *)header10 + +sizeof (SCSI_MODE_PARAMETER_HEADER6 ) + +sizeof (SCSI_MODE_PARAMTER_BLOCK_DESCRIPTER ), + byteCount); }/*