From patchwork Sat Aug 15 20:57:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 7021461 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 1FB32C05AC for ; Sat, 15 Aug 2015 20:58:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE83A20524 for ; Sat, 15 Aug 2015 20:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7218120523 for ; Sat, 15 Aug 2015 20:58:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754544AbbHOU6K (ORCPT ); Sat, 15 Aug 2015 16:58:10 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38862 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752878AbbHOU6I (ORCPT ); Sat, 15 Aug 2015 16:58:08 -0400 Received: by wicja10 with SMTP id ja10so49528144wic.1 for ; Sat, 15 Aug 2015 13:58:07 -0700 (PDT) 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=2lRf091V46B1k+bqez7A6IPddn5l90lKzbGnsQNB8xY=; b=zVQK0ewlGNyFdBIiZcC29H4IKG2bd3VNY52mV5SQOn5j6TQAYhNxf/Pnzs69fsfeAN I3dPc/8ISiKtpjhpBwzFdxNjA0fC9LPNJ0ngeF9UwaqeB/XiW6RDQKDfB/hF/7MhbXoW tfMO7pj4p0cvVsO5VznslkxVlVHrctDoMn1wkA+gevugTFAweanzkgUeHoOpt4IWOJ0Z zBKg+PY1Lx5lQw1onIXrzhcpRyWFAE6gjhjKLFOjlN3+Z0v6/E3aR1ZbhEi8piVvzpat hdw6b5JKkDc8M5jtKGh89my3Skvkye/Z9S06orsCcJBazLtklRGxNCUKbMlZCxsdkjyU APUA== X-Received: by 10.180.8.234 with SMTP id u10mr19176353wia.4.1439672287539; Sat, 15 Aug 2015 13:58:07 -0700 (PDT) Received: from tipsey.3.home (188.31.160.140.threembb.co.uk. [188.31.160.140]) by smtp.gmail.com with ESMTPSA id jr5sm14438355wjc.14.2015.08.15.13.58.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Aug 2015 13:58:07 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 4/4] staging: vt6655: replace typedef struct tagSRxDesc Date: Sat, 15 Aug 2015 21:57:35 +0100 Message-Id: <1439672255-2548-4-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1439672255-2548-1-git-send-email-tvboxspy@gmail.com> References: <1439672255-2548-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, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 with struct vnt_rx_desc and all members the same. volatile is removed from pointers as this generates warning message. Only the first four members of vnt_rx_desc need to be volatile. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/card.c | 2 +- drivers/staging/vt6655/desc.h | 8 +++--- drivers/staging/vt6655/device.h | 6 ++--- drivers/staging/vt6655/device_main.c | 51 +++++++++++++++++++----------------- drivers/staging/vt6655/dpc.c | 2 +- drivers/staging/vt6655/dpc.h | 2 +- 6 files changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index 7a30ba2..ecbe94f 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -564,7 +564,7 @@ CARDvSafeResetRx( ) { unsigned int uu; - PSRxDesc pDesc; + struct vnt_rx_desc *pDesc; /* initialize RD index */ pDevice->pCurrRD[0] = &(pDevice->aRD0Ring[0]); diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 752c546..9fbc717 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -195,16 +195,14 @@ struct vnt_rdes1 { } __packed; /* Rx descriptor*/ -typedef struct tagSRxDesc { +struct vnt_rx_desc { volatile struct vnt_rdes0 rd0; volatile struct vnt_rdes1 rd1; volatile __le32 buff_addr; volatile __le32 next_desc; - struct tagSRxDesc *next __aligned(8); + struct vnt_rx_desc *next __aligned(8); struct vnt_rd_info *rd_info __aligned(8); -} __attribute__ ((__packed__)) -SRxDesc, *PSRxDesc; -typedef const SRxDesc *PCSRxDesc; +} __packed; struct vnt_tdes0 { volatile u8 tsr0; diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h index 80cc170..d1917d0 100644 --- a/drivers/staging/vt6655/device.h +++ b/drivers/staging/vt6655/device.h @@ -258,9 +258,9 @@ struct vnt_private { struct vnt_tx_desc *apTD0Rings; struct vnt_tx_desc *apTD1Rings; - volatile PSRxDesc aRD0Ring; - volatile PSRxDesc aRD1Ring; - volatile PSRxDesc pCurrRD[TYPE_MAXRD]; + struct vnt_rx_desc *aRD0Ring; + struct vnt_rx_desc *aRD1Ring; + struct vnt_rx_desc *pCurrRD[TYPE_MAXRD]; OPTIONS sOpts; diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index defdcc0..86c24a1 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -155,7 +155,7 @@ static void device_init_td1_ring(struct vnt_private *pDevice); static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx); static int device_tx_srv(struct vnt_private *pDevice, unsigned int uIdx); -static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pDesc); +static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *); static void device_init_registers(struct vnt_private *pDevice); static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *); static void device_free_td0_ring(struct vnt_private *pDevice); @@ -520,8 +520,8 @@ static bool device_init_rings(struct vnt_private *pDevice) /*allocate all RD/TD rings a single pool*/ vir_pool = dma_zalloc_coherent(&pDevice->pcid->dev, - pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + - pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc), &pDevice->pool_dma, GFP_ATOMIC); @@ -532,11 +532,11 @@ static bool device_init_rings(struct vnt_private *pDevice) pDevice->aRD0Ring = vir_pool; pDevice->aRD1Ring = vir_pool + - pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc); pDevice->rd0_pool_dma = pDevice->pool_dma; pDevice->rd1_pool_dma = pDevice->rd0_pool_dma + - pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc); + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc); pDevice->tx0_bufs = dma_zalloc_coherent(&pDevice->pcid->dev, pDevice->sOpts.nTxDescs[0] * PKT_BUF_SZ + @@ -549,8 +549,8 @@ static bool device_init_rings(struct vnt_private *pDevice) dev_err(&pDevice->pcid->dev, "allocate buf dma memory failed\n"); dma_free_coherent(&pDevice->pcid->dev, - pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + - pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc), vir_pool, pDevice->pool_dma @@ -559,19 +559,19 @@ static bool device_init_rings(struct vnt_private *pDevice) } pDevice->td0_pool_dma = pDevice->rd1_pool_dma + - pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc); + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc); pDevice->td1_pool_dma = pDevice->td0_pool_dma + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc); /* vir_pool: pvoid type */ pDevice->apTD0Rings = vir_pool - + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) - + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc); + + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc); pDevice->apTD1Rings = vir_pool - + pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) - + pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc); pDevice->tx1_bufs = pDevice->tx0_bufs + @@ -595,8 +595,8 @@ static bool device_init_rings(struct vnt_private *pDevice) static void device_free_rings(struct vnt_private *pDevice) { dma_free_coherent(&pDevice->pcid->dev, - pDevice->sOpts.nRxDescs0 * sizeof(SRxDesc) + - pDevice->sOpts.nRxDescs1 * sizeof(SRxDesc) + + pDevice->sOpts.nRxDescs0 * sizeof(struct vnt_rx_desc) + + pDevice->sOpts.nRxDescs1 * sizeof(struct vnt_rx_desc) + pDevice->sOpts.nTxDescs[0] * sizeof(struct vnt_tx_desc) + pDevice->sOpts.nTxDescs[1] * sizeof(struct vnt_tx_desc) , @@ -617,10 +617,11 @@ static void device_init_rd0_ring(struct vnt_private *pDevice) { int i; dma_addr_t curr = pDevice->rd0_pool_dma; - PSRxDesc pDesc; + struct vnt_rx_desc *pDesc; /* Init the RD0 ring entries */ - for (i = 0; i < pDevice->sOpts.nRxDescs0; i ++, curr += sizeof(SRxDesc)) { + for (i = 0; i < pDevice->sOpts.nRxDescs0; + i ++, curr += sizeof(struct vnt_rx_desc)) { pDesc = &(pDevice->aRD0Ring[i]); pDesc->rd_info = alloc_rd_info(); @@ -628,7 +629,7 @@ static void device_init_rd0_ring(struct vnt_private *pDevice) dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n"); pDesc->next = &(pDevice->aRD0Ring[(i+1) % pDevice->sOpts.nRxDescs0]); - pDesc->next_desc = cpu_to_le32(curr + sizeof(SRxDesc)); + pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc)); } if (i > 0) @@ -640,10 +641,11 @@ static void device_init_rd1_ring(struct vnt_private *pDevice) { int i; dma_addr_t curr = pDevice->rd1_pool_dma; - PSRxDesc pDesc; + struct vnt_rx_desc *pDesc; /* Init the RD1 ring entries */ - for (i = 0; i < pDevice->sOpts.nRxDescs1; i ++, curr += sizeof(SRxDesc)) { + for (i = 0; i < pDevice->sOpts.nRxDescs1; + i ++, curr += sizeof(struct vnt_rx_desc)) { pDesc = &(pDevice->aRD1Ring[i]); pDesc->rd_info = alloc_rd_info(); @@ -651,7 +653,7 @@ static void device_init_rd1_ring(struct vnt_private *pDevice) dev_err(&pDevice->pcid->dev, "can not alloc rx bufs\n"); pDesc->next = &(pDevice->aRD1Ring[(i+1) % pDevice->sOpts.nRxDescs1]); - pDesc->next_desc = cpu_to_le32(curr + sizeof(SRxDesc)); + pDesc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc)); } if (i > 0) @@ -664,7 +666,7 @@ static void device_free_rd0_ring(struct vnt_private *pDevice) int i; for (i = 0; i < pDevice->sOpts.nRxDescs0; i++) { - PSRxDesc pDesc = &(pDevice->aRD0Ring[i]); + struct vnt_rx_desc *pDesc = &(pDevice->aRD0Ring[i]); struct vnt_rd_info *rd_info = pDesc->rd_info; dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma, @@ -681,7 +683,7 @@ static void device_free_rd1_ring(struct vnt_private *pDevice) int i; for (i = 0; i < pDevice->sOpts.nRxDescs1; i++) { - PSRxDesc pDesc = &(pDevice->aRD1Ring[i]); + struct vnt_rx_desc *pDesc = &(pDevice->aRD1Ring[i]); struct vnt_rd_info *rd_info = pDesc->rd_info; dma_unmap_single(&pDevice->pcid->dev, rd_info->skb_dma, @@ -774,7 +776,7 @@ static void device_free_td1_ring(struct vnt_private *pDevice) static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) { - PSRxDesc pRD; + struct vnt_rx_desc *pRD; int works = 0; for (pRD = pDevice->pCurrRD[uIdx]; @@ -801,7 +803,8 @@ static int device_rx_srv(struct vnt_private *pDevice, unsigned int uIdx) return works; } -static bool device_alloc_rx_buf(struct vnt_private *pDevice, PSRxDesc pRD) +static bool device_alloc_rx_buf(struct vnt_private *pDevice, + struct vnt_rx_desc *pRD) { struct vnt_rd_info *pRDInfo = pRD->rd_info; diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index 4659185..700032e 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -132,7 +132,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb, return true; } -bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd) +bool vnt_receive_frame(struct vnt_private *priv, struct vnt_rx_desc *curr_rd) { struct vnt_rd_info *rd_info = curr_rd->rd_info; struct sk_buff *skb; diff --git a/drivers/staging/vt6655/dpc.h b/drivers/staging/vt6655/dpc.h index ad49571..e80b308 100644 --- a/drivers/staging/vt6655/dpc.h +++ b/drivers/staging/vt6655/dpc.h @@ -31,6 +31,6 @@ #include "device.h" -bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd); +bool vnt_receive_frame(struct vnt_private *priv, struct vnt_rx_desc *curr_rd); #endif /* __RXTX_H__ */