From patchwork Sun Feb 28 19:02:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 8447681 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED0C59F659 for ; Sun, 28 Feb 2016 19:03:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 209CF201FE for ; Sun, 28 Feb 2016 19:03:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 443A5202DD for ; Sun, 28 Feb 2016 19:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754704AbcB1TDO (ORCPT ); Sun, 28 Feb 2016 14:03:14 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35497 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754187AbcB1TDN (ORCPT ); Sun, 28 Feb 2016 14:03:13 -0500 Received: by mail-wm0-f66.google.com with SMTP id 1so1583469wmg.2 for ; Sun, 28 Feb 2016 11:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lsRYCDZ2jPvivgvBppQnEtVccOmhNMEG6cMc/7nb17k=; b=FEY8cvBH+K5GWK7pPS143ngHPTOVDSsz4ubsPqCUcQwvJLMaRD8Bh7j9x1KeYK6ZyU p7nPcmBV1F/0oP1jgGeO3rfwCH6GDXupUZUh0nKEDbjxN8SWj5zryj0r3KIyZEwlXdUk 56HMa7q3+4Ewb2c6HLSRgCqX8KemIFyTguNUM2QDruNCP3WdwBFB8leQIrb2+O5FWci9 ARQMRXg0Wloa12tLRUWl8iK/vqYXPsBC+hO0AIDIbN2a6GmuRH7qF0jl6wMfQXV6t6Ez nGRLgZhktAgMoDoDAzN8Hnq08inf47ZNKsok/+AFG8c3clv1p4uc+jsRQDAstQZ9XfBF OmWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lsRYCDZ2jPvivgvBppQnEtVccOmhNMEG6cMc/7nb17k=; b=lGIGFgpqmt8rWhGQT/9p6t7QFq5zfjVulXA42y/cEbxkzpQpMfcvXWdiq7m9HQdAg3 bX++7DwS98r+vPnlNcUgwzrEE3phVkHJ0J3obN1XPOJSbEt+rMLeSFl48Kh/Odf+gU22 f4TqcnnntbhhMDvNsA3Cuwsm/LqClkhJR30v0Cqew2slP3FuQyory+ubIn5QSXAMZoqS M37Qc8gI72yCeyQcctbZhhMfHr+TZVF84xPxugwO1hshh8hJk8wurdBK23RBP9EunnCV h2ZFT8adm4EDcacxDrh4Kpk/oK5Aqpr53tnKihhPakpljP7Ct12KOE0Bf22GOGgecm2g 4Zzw== X-Gm-Message-State: AD7BkJIPoflseFCGF+TE07xkwe5onfr/st2GhGXwOLxpYi5achdpABY4p+bOshQUFA7mCw== X-Received: by 10.28.228.214 with SMTP id b205mr8534692wmh.94.1456686192316; Sun, 28 Feb 2016 11:03:12 -0800 (PST) Received: from tipsey.3.home (188.31.161.124.threembb.co.uk. [188.31.161.124]) by smtp.gmail.com with ESMTPSA id w144sm12685086wmd.8.2016.02.28.11.03.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Feb 2016 11:03:11 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 4/4] staging: vt6655: MACvSaveContext use memcpy_fromio to read context. Date: Sun, 28 Feb 2016 19:02:57 +0000 Message-Id: <1456686177-3167-4-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456686177-3167-1-git-send-email-tvboxspy@gmail.com> References: <1456686177-3167-1-git-send-email-tvboxspy@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use memcpy_fromio to store data removing the need for local count. Signed-off-by: Malcolm Priestley --- 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); }