From patchwork Sun Feb 28 19:02:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 8447671 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 7C9ED9F2F0 for ; Sun, 28 Feb 2016 19:03:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69AF7202BE for ; Sun, 28 Feb 2016 19:03:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BCCE201FE for ; Sun, 28 Feb 2016 19:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754600AbcB1TDN (ORCPT ); Sun, 28 Feb 2016 14:03:13 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35477 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754213AbcB1TDM (ORCPT ); Sun, 28 Feb 2016 14:03:12 -0500 Received: by mail-wm0-f66.google.com with SMTP id 1so1583343wmg.2 for ; Sun, 28 Feb 2016 11:03:11 -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=xkaXpYE/5gdBQb41ptSdMDMw5OZInB1Qsm64IqO4ErU=; b=eewQpBmmq4lU0TtXWcvQmQKT2RT5lHJJ2tJMDmSJgmX6DeTq4Cw18UoBmuk0RgBW9C QVvk34NIjeJ/467Nd7ZP4rs6eHXzHqD4XqO+7vpkezXm9/x/274iGSq6FJGEJNKj1rV7 3+obrcKHQvXYQsSGRIHuxCAlxLwCiwKshwadsrBm38+hRCJQgwT5zadfB70lZp8lMGzL FLVsnx3GVTI6Mjajxt3Ou1WzAf1UkoLt9lUGNOI0Qt7s6k8qHfR2T3qk9SVqCIUGjnoi K9ekvi9hkRL3xtdpOeF85sBzB9NjSVPTO3VnZUwIT5xQ+16TmM2xA43YAD0u/7ghWPIO xkEg== 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=xkaXpYE/5gdBQb41ptSdMDMw5OZInB1Qsm64IqO4ErU=; b=asi2qQy5a+xul/eMQg3i6WI0pZDJ1EGhdjZ3UzblrmtWGWY1Zecpunm44FI6BVgyf+ 7MelvFbzXf7idePslwIXnet5nA1Bnisf3RlJdsTky//TyKb4rtu/fWinboYuL880JL5m QYbdmxKJgjnLU15zJ9FmaJ95ruNkayzCxvzgS1J9R2t05Ex2VKA9g3fs8LfHvqMIUnMW zXkx51mAQWkvvn7ctIvuiw8SRX7c9G4kZPzFRjMNcWfblEyi980kGu0jYewPXmoOBBQG wl3vSNhMuOQKZEeCzXSa/iPnmftTI1PqDX2wucwegRRklJSl44bTLVCC4WpgJ7yGOAR1 kfkw== X-Gm-Message-State: AD7BkJKLHsK8Dhfo49QTH+OFJGi6FFbNBIn1aK3M/a37vyF3M0rzT7q0+i+sW7cUL59XPQ== X-Received: by 10.194.103.198 with SMTP id fy6mr13454504wjb.48.1456686190542; Sun, 28 Feb 2016 11:03:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Feb 2016 11:03:10 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 2/4] staging: vt6655: mac.c Replace VNSvInPortB byData reads with ioread8. Date: Sun, 28 Feb 2016 19:02:55 +0000 Message-Id: <1456686177-3167-2-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 Removing byData variable altogether. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/mac.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/drivers/staging/vt6655/mac.c b/drivers/staging/vt6655/mac.c index 5a4fc3b..893fc52 100644 --- a/drivers/staging/vt6655/mac.c +++ b/drivers/staging/vt6655/mac.c @@ -74,10 +74,8 @@ bool MACbIsRegBitsOn(struct vnt_private *priv, unsigned char byRegOfs, unsigned char byTestBits) { void __iomem *io_base = priv->PortOffset; - unsigned char byData; - VNSvInPortB(io_base + byRegOfs, &byData); - return (byData & byTestBits) == byTestBits; + return (ioread8(io_base + byRegOfs) & byTestBits) == byTestBits; } /* @@ -99,10 +97,8 @@ bool MACbIsRegBitsOff(struct vnt_private *priv, unsigned char byRegOfs, unsigned char byTestBits) { void __iomem *io_base = priv->PortOffset; - unsigned char byData; - VNSvInPortB(io_base + byRegOfs, &byData); - return !(byData & byTestBits); + return !(ioread8(io_base + byRegOfs) & byTestBits); } /* @@ -304,15 +300,13 @@ void MACvRestoreContext(struct vnt_private *priv, unsigned char *pbyCxtBuf) bool MACbSoftwareReset(struct vnt_private *priv) { void __iomem *io_base = priv->PortOffset; - unsigned char byData; unsigned short ww; /* turn on HOSTCR_SOFTRST, just write 0x01 to reset */ VNSvOutPortB(io_base + MAC_REG_HOSTCR, 0x01); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData); - if (!(byData & HOSTCR_SOFTRST)) + if (!(ioread8(io_base + MAC_REG_HOSTCR) & HOSTCR_SOFTRST)) break; } if (ww == W_MAX_TIMEOUT) @@ -370,7 +364,6 @@ bool MACbSafeRxOff(struct vnt_private *priv) void __iomem *io_base = priv->PortOffset; unsigned short ww; unsigned long dwData; - unsigned char byData; /* turn off wow temp for turn off Rx safely */ @@ -400,8 +393,7 @@ bool MACbSafeRxOff(struct vnt_private *priv) MACvRegBitsOff(io_base, MAC_REG_HOSTCR, HOSTCR_RXON); /* W_MAX_TIMEOUT is the timeout period */ for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData); - if (!(byData & HOSTCR_RXONST)) + if (!(ioread8(io_base + MAC_REG_HOSTCR) & HOSTCR_RXONST)) break; } if (ww == W_MAX_TIMEOUT) { @@ -429,7 +421,6 @@ bool MACbSafeTxOff(struct vnt_private *priv) void __iomem *io_base = priv->PortOffset; unsigned short ww; unsigned long dwData; - unsigned char byData; /* Clear TX DMA */ /* Tx0 */ @@ -461,8 +452,7 @@ bool MACbSafeTxOff(struct vnt_private *priv) /* W_MAX_TIMEOUT is the timeout period */ for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_HOSTCR, &byData); - if (!(byData & HOSTCR_TXONST)) + if (!(ioread8(io_base + MAC_REG_HOSTCR) & HOSTCR_TXONST)) break; } if (ww == W_MAX_TIMEOUT) { @@ -584,7 +574,6 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd { void __iomem *io_base = priv->PortOffset; unsigned short ww; - unsigned char byData; unsigned char byOrgDMACtl; VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byOrgDMACtl); @@ -592,8 +581,7 @@ void MACvSetCurrRx0DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd VNSvOutPortB(io_base + MAC_REG_RXDMACTL0+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_RXDMACTL0, &byData); - if (!(byData & DMACTL_RUN)) + if (!(ioread8(io_base + MAC_REG_RXDMACTL0) & DMACTL_RUN)) break; } @@ -620,7 +608,6 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd { void __iomem *io_base = priv->PortOffset; unsigned short ww; - unsigned char byData; unsigned char byOrgDMACtl; VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byOrgDMACtl); @@ -628,8 +615,7 @@ void MACvSetCurrRx1DescAddr(struct vnt_private *priv, unsigned long dwCurrDescAd VNSvOutPortB(io_base + MAC_REG_RXDMACTL1+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_RXDMACTL1, &byData); - if (!(byData & DMACTL_RUN)) + if (!(ioread8(io_base + MAC_REG_RXDMACTL1) & DMACTL_RUN)) break; } @@ -658,7 +644,6 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv, { void __iomem *io_base = priv->PortOffset; unsigned short ww; - unsigned char byData; unsigned char byOrgDMACtl; VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byOrgDMACtl); @@ -666,8 +651,7 @@ void MACvSetCurrTx0DescAddrEx(struct vnt_private *priv, VNSvOutPortB(io_base + MAC_REG_TXDMACTL0+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_TXDMACTL0, &byData); - if (!(byData & DMACTL_RUN)) + if (!(ioread8(io_base + MAC_REG_TXDMACTL0) & DMACTL_RUN)) break; } @@ -696,7 +680,6 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv, { void __iomem *io_base = priv->PortOffset; unsigned short ww; - unsigned char byData; unsigned char byOrgDMACtl; VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byOrgDMACtl); @@ -704,8 +687,7 @@ void MACvSetCurrAC0DescAddrEx(struct vnt_private *priv, VNSvOutPortB(io_base + MAC_REG_AC0DMACTL+2, DMACTL_RUN); for (ww = 0; ww < W_MAX_TIMEOUT; ww++) { - VNSvInPortB(io_base + MAC_REG_AC0DMACTL, &byData); - if (!(byData & DMACTL_RUN)) + if (!(ioread8(io_base + MAC_REG_AC0DMACTL) & DMACTL_RUN)) break; } if (ww == W_MAX_TIMEOUT)