From patchwork Sun Mar 6 12:57:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 8513261 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98699C0553 for ; Sun, 6 Mar 2016 12:57:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DB8E20172 for ; Sun, 6 Mar 2016 12:57:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A33902017E for ; Sun, 6 Mar 2016 12:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751517AbcCFM5a (ORCPT ); Sun, 6 Mar 2016 07:57:30 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35791 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751366AbcCFM51 (ORCPT ); Sun, 6 Mar 2016 07:57:27 -0500 Received: by mail-wm0-f67.google.com with SMTP id 1so6277264wmg.2 for ; Sun, 06 Mar 2016 04:57:27 -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=xA7wllvkMJMDT9wfrq0BCXqmm91DfmBPIUvWVwDzsX8=; b=cx2GSsfFLPRFhgvOB+/AoJScG2uzw1DXybiQOUJbyCod7JnCdKHjf0mTN4NYjfTSO3 aG22W2S+q9wh29oKIGNT4V5OA7Oy2E0AAcaCdijLSDYwd+x2LWO4nBzzhTBWZzTrAmM9 bN8gI6PQkNNfQzOiWaA7s/+GRQN2pvxOe4Gm9GcwIXBHO/YYd6cF5Yd3S9wccejB/mT2 J/edIW+jUbcei/P1zBsSegaxwMMI/Qsnb7Q9oiWwhY3JZaV9mrbccuPUW8wu9BTvnBuz tCbakLKuSj7fQ4aEc6Is4nS7d3+4zMkJEMQjIcZS7vQiW630Js//q/NvWBjOD2Wso8ZY +rfQ== 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=xA7wllvkMJMDT9wfrq0BCXqmm91DfmBPIUvWVwDzsX8=; b=iQy6yTr5TmXaANU9RL5nBHUqQPXgZvMz6/qiiynZzQ3eMsWFwqH4K87X3cRha+BDhP 7FzbTGjhYhmdtJphonOCKdkESf/5OYzWL2byug50dwglPP32Iqa7GvQqKyMhocI7IAQy RD3h7ZhTEjXb5jD90+d//KJSe2beBgDVTkYiDxyOXHt0HgVfBdodx75QTTxHxHvcd6fO kKx6eyn70TKgbgTc/k83CWFEQKONzYjoH+DvNemkuUSg+v5zngqM1kmtMziCSQswEVPz dAOpCKLeNYIZd6V545zACZenYBDSmV+EWOmvmVyankGFVrW3jWEWwaR0ArtNiKzG//wT oXJg== X-Gm-Message-State: AD7BkJIBewWR9HsQWUzVCoUiT5RLayW0Q41y81liX4KPYQjQmjbokdYEJni+bj3L7YyLtw== X-Received: by 10.194.2.76 with SMTP id 12mr18144931wjs.28.1457269046367; Sun, 06 Mar 2016 04:57:26 -0800 (PST) Received: from tipsey.3.home (188.30.137.64.threembb.co.uk. [188.30.137.64]) by smtp.gmail.com with ESMTPSA id n10sm12839950wjf.28.2016.03.06.04.57.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Mar 2016 04:57:25 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 02/13] staging: vt6655: MACvRestoreContext replace for loops with memcpy_toio. Date: Sun, 6 Mar 2016 12:57:01 +0000 Message-Id: <1457269032-2681-2-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457269032-2681-1-git-send-email-tvboxspy@gmail.com> References: <1457269032-2681-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 Removing the need for variable ii. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/mac.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index 9c4dabd..02e3e42 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -240,29 +240,27 @@ void MACvSaveContext(struct vnt_private *priv, unsigned char *cxt_buf) void MACvRestoreContext(struct vnt_private *priv, unsigned char *cxt_buf) { void __iomem *io_base = priv->PortOffset; - int ii; MACvSelectPage1(io_base); /* restore page1 */ - for (ii = 0; ii < MAC_MAX_CONTEXT_SIZE_PAGE1; ii++) - VNSvOutPortB((io_base + ii), - *(cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0 + ii)); + memcpy_toio(io_base, cxt_buf + MAC_MAX_CONTEXT_SIZE_PAGE0, + MAC_MAX_CONTEXT_SIZE_PAGE1); MACvSelectPage0(io_base); /* restore RCR,TCR,IMR... */ - for (ii = MAC_REG_RCR; ii < MAC_REG_ISR; ii++) - VNSvOutPortB(io_base + ii, *(cxt_buf + ii)); + memcpy_toio(io_base + MAC_REG_RCR, cxt_buf + MAC_REG_RCR, + MAC_REG_ISR - MAC_REG_RCR); /* restore MAC Config. */ - for (ii = MAC_REG_LRT; ii < MAC_REG_PAGE1SEL; ii++) - VNSvOutPortB(io_base + ii, *(cxt_buf + ii)); + memcpy_toio(io_base + MAC_REG_LRT, cxt_buf + MAC_REG_LRT, + MAC_REG_PAGE1SEL - MAC_REG_LRT); VNSvOutPortB(io_base + MAC_REG_CFG, *(cxt_buf + MAC_REG_CFG)); /* restore PS Config. */ - for (ii = MAC_REG_PSCFG; ii < MAC_REG_BBREGCTL; ii++) - VNSvOutPortB(io_base + ii, *(cxt_buf + ii)); + memcpy_toio(io_base + MAC_REG_PSCFG, cxt_buf + MAC_REG_PSCFG, + MAC_REG_BBREGCTL - MAC_REG_PSCFG); /* restore CURR_RX_DESC_ADDR, CURR_TX_DESC_ADDR */ VNSvOutPortD(io_base + MAC_REG_TXDMAPTR0,