]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
staging: vt6655: MACvSaveContext use memcpy_fromio to read context.
authorMalcolm Priestley <tvboxspy@gmail.com>
Sun, 28 Feb 2016 19:02:57 +0000 (19:02 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2016 03:17:17 +0000 (19:17 -0800)
Use memcpy_fromio to store data removing the need for local count.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6655/mac.c

index c93592213310a24722b682a049122bdb44167f71..66ae991374080deb2ffe4598e7891b45e37c49fc 100644 (file)
@@ -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);
 }