From patchwork Wed Jul 22 18:16:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 6845811 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 260F9C05AC for ; Wed, 22 Jul 2015 18:18:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4883020499 for ; Wed, 22 Jul 2015 18:18:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DC79204A7 for ; Wed, 22 Jul 2015 18:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752747AbbGVSR4 (ORCPT ); Wed, 22 Jul 2015 14:17:56 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36568 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbbGVSRz (ORCPT ); Wed, 22 Jul 2015 14:17:55 -0400 Received: by wicgb10 with SMTP id gb10so109877025wic.1 for ; Wed, 22 Jul 2015 11:17:54 -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=l5Ug8lXS2ua7IJWxZcNHbZDZCZShdaN1ltLgEz8/Kp0=; b=lMMIca0hXpc1yxPGOuXj3h4kl57obUcsZb1pjR6fvFd6+Os1iD0VpQ75Qu7F+T22DK Jj/Kqu7W5ifiHKVsI/LHW6csV3M3D/m/GtIDbULICoXi77ox857y6qfDjXkG4GMRJ8Fr 8gcVUSjg0EZhcgWm561g3KnlPyWTw2X8XAopppdkuiP/tk377sc+aGi4OJA1aonKvF0u 0bSb6P3+F5b+O3SIKos2rc6cRf5iFczpV1ju67W16bP9oUIZ8iwwq8g7h1ESutDCHl+D x8PJ4TMrM4rT/mbnwTD2xtFYu30aa2eFE1DhR9t/2Ce5HkRsEiDuoHmpB7/cBGsUkU2p wRkQ== X-Received: by 10.180.14.101 with SMTP id o5mr9188342wic.82.1437589074391; Wed, 22 Jul 2015 11:17:54 -0700 (PDT) Received: from tipsey.3.home (188.30.183.207.threembb.co.uk. [188.30.183.207]) by smtp.gmail.com with ESMTPSA id ha4sm23219334wib.0.2015.07.22.11.17.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jul 2015 11:17:53 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, Malcolm Priestley Subject: [PATCH 11/15] staging: vt6655: Fix wReqCount to __le16 Date: Wed, 22 Jul 2015 19:16:43 +0100 Message-Id: <1437589007-5479-11-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437589007-5479-1-git-send-email-tvboxspy@gmail.com> References: <1437589007-5479-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=-8.0 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 Should be __le16 and do and correct endian conversion. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/card.c | 8 ++++---- drivers/staging/vt6655/desc.h | 6 +++--- drivers/staging/vt6655/dpc.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index df62bdc..ae8fd7f 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -573,17 +573,17 @@ CARDvSafeResetRx( /* init state, all RD is chip's */ for (uu = 0; uu < pDevice->sOpts.nRxDescs0; uu++) { pDesc = &(pDevice->aRD0Ring[uu]); - pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz); + pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz); pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC; - pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz); + pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz); } /* init state, all RD is chip's */ for (uu = 0; uu < pDevice->sOpts.nRxDescs1; uu++) { pDesc = &(pDevice->aRD1Ring[uu]); - pDesc->m_rd0RD0.wResCount = (unsigned short)(pDevice->rx_buf_sz); + pDesc->m_rd0RD0.wResCount = cpu_to_le16(pDevice->rx_buf_sz); pDesc->m_rd0RD0.f1Owner = OWNED_BY_NIC; - pDesc->m_rd1RD1.wReqCount = (unsigned short)(pDevice->rx_buf_sz); + pDesc->m_rd1RD1.wReqCount = cpu_to_le16(pDevice->rx_buf_sz); } /* set perPkt mode */ diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h index 251f7bc..f6563d3 100644 --- a/drivers/staging/vt6655/desc.h +++ b/drivers/staging/vt6655/desc.h @@ -175,7 +175,7 @@ typedef struct tagDEVICE_RD_INFO { #ifdef __BIG_ENDIAN typedef struct tagRDES0 { - volatile unsigned short wResCount; + volatile __le16 wResCount; union { volatile u16 f15Reserved; struct { @@ -190,7 +190,7 @@ SRDES0, *PSRDES0; #else typedef struct tagRDES0 { - unsigned short wResCount; + __le16 wResCount; unsigned short f15Reserved:15; unsigned short f1Owner:1; } __attribute__ ((__packed__)) @@ -199,7 +199,7 @@ SRDES0; #endif typedef struct tagRDES1 { - unsigned short wReqCount; + __le16 wReqCount; unsigned short wReserved; } __attribute__ ((__packed__)) SRDES1; diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index b25ee96..e14eed1 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -144,7 +144,7 @@ bool vnt_receive_frame(struct vnt_private *priv, PSRxDesc curr_rd) priv->rx_buf_sz, DMA_FROM_DEVICE); frame_size = le16_to_cpu(curr_rd->m_rd1RD1.wReqCount) - - cpu_to_le16(curr_rd->m_rd0RD0.wResCount); + - le16_to_cpu(curr_rd->m_rd0RD0.wResCount); if ((frame_size > 2364) || (frame_size < 33)) { /* Frame Size error drop this packet.*/