All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Donald.Huang@ite.com.tw, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] iteraid: remove home-grown memmove()
Date: Sat, 18 Jun 2005 02:42:35 +0400	[thread overview]
Message-ID: <200506180242.35178.adobriyan@gmail.com> (raw)

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 drivers/scsi/iteraid.c |   46 ++++++----------------------------------------
 1 files changed, 6 insertions(+), 40 deletions(-)

Index: linux-iteraid/drivers/scsi/iteraid.c
===================================================================
--- linux-iteraid.orig/drivers/scsi/iteraid.c	2005-06-18 02:00:27.000000000 +0400
+++ linux-iteraid/drivers/scsi/iteraid.c	2005-06-18 02:20:45.000000000 +0400
@@ -3194,36 +3194,6 @@ static u8 IdeVerify(PChannel pChan, PSCS
 	return 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, P
 			    sizeof(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);
 			}
 
 			/*

                 reply	other threads:[~2005-06-17 22:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200506180242.35178.adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=Donald.Huang@ite.com.tw \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.