linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Malcolm Priestley <tvboxspy@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-wireless@vger.kernel.org, Malcolm Priestley <tvboxspy@gmail.com>
Subject: [PATCH 4/4] staging: vt6655: MACvSaveContext use memcpy_fromio to read context.
Date: Sun, 28 Feb 2016 19:02:57 +0000	[thread overview]
Message-ID: <1456686177-3167-4-git-send-email-tvboxspy@gmail.com> (raw)
In-Reply-To: <1456686177-3167-1-git-send-email-tvboxspy@gmail.com>

Use memcpy_fromio to store data removing the need for local count.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6655/mac.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c
index c935922..66ae991 100644
--- a/drivers/staging/vt6655/mac.c
+++ b/drivers/staging/vt6655/mac.c
@@ -210,18 +210,15 @@ void MACvSetLoopbackMode(struct vnt_private *priv, unsigned char byLoopbackMode)
 void MACvSaveContext(struct vnt_private *priv, unsigned char *pbyCxtBuf)
 {
 	void __iomem *io_base = priv->PortOffset;
-	int         ii;
 
 	/* read page0 register */
-	for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE0; ii++)
-		VNSvInPortB((io_base + ii), (pbyCxtBuf + ii));
+	memcpy_fromio(pbyCxtBuf, io_base, MAC_MAX_CONTEXT_SIZE_PAGE0);
 
 	MACvSelectPage1(io_base);
 
 	/* read page1 register */
-	for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++)
-		VNSvInPortB((io_base + ii),
-			    (pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii));
+	memcpy_fromio(pbyCxtBuf + MAC_MAX_CONTEXT_SIZE_PAGE0, io_base,
+		      MAC_MAX_CONTEXT_SIZE_PAGE1);
 
 	MACvSelectPage0(io_base);
 }
-- 
2.7.0


      parent reply	other threads:[~2016-02-28 19:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 19:02 [PATCH 1/4] staging: vt6655: mac.c rename dwIoBase to io_base Malcolm Priestley
2016-02-28 19:02 ` [PATCH 2/4] staging: vt6655: mac.c Replace VNSvInPortB byData reads with ioread8 Malcolm Priestley
2016-02-28 19:02 ` [PATCH 3/4] staging: vt6655: replace VNSvInPortD dwData reads with ioread32 Malcolm Priestley
2016-02-28 19:02 ` Malcolm Priestley [this message]

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=1456686177-3167-4-git-send-email-tvboxspy@gmail.com \
    --to=tvboxspy@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-wireless@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).