From patchwork Mon May 11 15:49:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 219460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A31AC47255 for ; Mon, 11 May 2020 15:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2036F206DB for ; Mon, 11 May 2020 15:51:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="DiAmqAUE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730783AbgEKPvU (ORCPT ); Mon, 11 May 2020 11:51:20 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730542AbgEKPuD (ORCPT ); Mon, 11 May 2020 11:50:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b7YGYjXp9t051nHpTkY1XEoIBWhb4M4XIKIyU7Pv/FF6OvSketRqxmGQ74C0Kg7xFkoVXUTyFVVTA1qYJn2QjNayMtAEdgCPFR0TvGMrTJImatPW0Qf1YHdbZaSCPcL5oHqN4PMnzX6eC24h8hioNQfxh9ZP2/AcMw+QkWMkIpQ3WHbykx3RgdqFyWCYwjH8JbrzaW7gEMzUVS5shZ92pxsPm7HysbaDEpP/iw6Vd+5IwR6OCZfsGCv9w39wiKmODAe0Z1+RGKKjJ2S7Yk9kjdOeUbsaHmsZ/8iGfvMcl4srZfp0EsTRrXLvXmgz0kaieuS8ZU6+LilJNAZvDhHu5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/IBOowGZWGLX/ya4+8HPPpCjBwLQmsN5qAwxVw+Vu+o=; b=XwDoMGRTE7mrIAuh74dWqGIyC4QR7qTFLntP3cLlKD3QWMeViQBxeLBTq1Rquc73x3bSwojOLniSUXrDUZ7ZLX7FMwqWWcE8bw4YG3c3wpYX2QrLXoxq+OCGp5M+ULORUoJ9DUkBX78mRBNV7eI3JN8J9jwZ2xIripTJdrJDNEVKvLIcZLNgM7P1cp+Kbb6Y0IssBiOkwmK/LS7mxc3gT+F2H7Qy75mvolMxkef/6Siz2yzux37eCrHAIDH7uFVI61Z66guzHXflcgu43xqPzqsGlPIvysQhC2ZyXgymPFNxN7N9z+n8WtzitB8fDvr7ilUI0Nac1hXmrJ3gz2O/VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/IBOowGZWGLX/ya4+8HPPpCjBwLQmsN5qAwxVw+Vu+o=; b=DiAmqAUE/tGktOAADn1ZwRNuZrz+Zzt3Df2QvnCLWH9QvKdyaeQnxiYM3PDh/9U4inosfFj+Q8ps5/sTiXJ9G5FarObUSSOQN8vvwjEP8ngPEGUkO6NTzo10EYvr5Dp34C5sUjss1YnfT9vYmetEOS+THXw6k5sY3hL5Zz+AKTU= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:49:57 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:49:57 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 06/17] staging: wfx: fix endianness of fields media_delay and tx_queue_delay Date: Mon, 11 May 2020 17:49:19 +0200 Message-Id: <20200511154930.190212-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:49:55 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7ebd07f5-2dc0-4c3b-caa6-08d7f5c2f478 X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x2ZKS0ZDZ6fXVyVevW56HJhA0O6RnP8B7z+sTehKH/nsh5Hq+WarjmmK9NfrxwJ3LNo8tcA9rlFl1Uqzjyt4RPx0CDPTNQozIhH6GKuzbAmYxJRM5Vt+34DBHK3i1So3k+Ja82nyJR1gQKmNlXj9DbubQ9V3p1RxdWdLBKCF8VR8GVKn0UYkVTt+fnMFm9f6W5u5+U1sVf/TIWTtU4SkdTB8kumf4mzM4RyHlxyep82XgSVM/QKJBJr5KA9lzCvrmV0KIxB5+hc+fIjPwcmYjcA0or7z1v3mTWhAFWCYUZMcGyg+WEtKcc3gCWNPvEi24aSgQuFZUFUBzyrDqQDdX2HhET3dnKd43JQVrBfL87Bu2zPDqTkAp+H24ctCSABSnGaLMREv+vmP1OYH1Bemt8IavvbszNZ0HKTZp3g1KsJCCyK9O4ESmNRkTAdYADrwTAv8yTdDRoHaBeTykE4wtPgA4WXga1eA8rtYrxxrFXGZmUGjBNPAVF1JXMSpnQ+QzHcgbMAoj6M0XMZBrDlAOw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IQ1yaaP6+zUMchLAxMCkiJw+IqALaHKztdZUwUZESiQu4NhW5dUcP2hfEb9EM91QZy46MOQxz1M/lUVm89zx4faLWkSg73amwtbp2mpjHC2BZrHtnSpQGZOQ+qQkNWrUsep72qA8fFETmuCy6VBMph3aPA6/30nxzVEm9XzN0scd4RlNk252HYbuO+CDlHxygKcUgpbjNxIO/ou3noaAQj7fReBo+1WdBOm6+SZXl7TbCziFE6zbDxIEMgXwc9G5hy/cRhIumV7zJQoEtZkIZk0vzv9Dc2sn7uGbbw2fQ/h4A/0Pv4caNq9rwghtHrJvX1CsXr+T+g8rqwNUpIjCkeqM97PDMknwwqokrLBKkZynMwH5Q5Gpqz3AcLLj9mOcaa+rU135AgTsRsOdv2sHr5WY7Vouv5UTHMvJmVIK5SzFfGAf6AF5ZHztSV9El5aKkLQ2SSR+DK0T/UJ/qpm6jHI7XySnGPd1olBsKNhs/WM= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ebd07f5-2dc0-4c3b-caa6-08d7f5c2f478 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:49:57.3300 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XEXj2CQdjTckyJpV8BpOzRvg0tmevapPmq1lwqcuvVvVudDrWGJErIv87xsvPjoA89oFNE22fVRdDw9IwGH67Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The struct hif_cnf_tx contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong access to fields media_delay and tx_queue_delay. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 ++- drivers/staging/wfx/traces.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index f64149ab0484..014fa36c8f78 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -562,7 +562,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) if (!arg->status) { tx_info->status.tx_time = - arg->media_delay - arg->tx_queue_delay; + le32_to_cpu(arg->media_delay) - + le32_to_cpu(arg->tx_queue_delay); if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) tx_info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; else diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h index c78c46b1c990..959a0d31bf4e 100644 --- a/drivers/staging/wfx/traces.h +++ b/drivers/staging/wfx/traces.h @@ -387,8 +387,8 @@ TRACE_EVENT(tx_stats, int i; __entry->pkt_id = tx_cnf->packet_id; - __entry->delay_media = tx_cnf->media_delay; - __entry->delay_queue = tx_cnf->tx_queue_delay; + __entry->delay_media = le32_to_cpu(tx_cnf->media_delay); + __entry->delay_queue = le32_to_cpu(tx_cnf->tx_queue_delay); __entry->delay_fw = delay; __entry->ack_failures = tx_cnf->ack_failures; if (!tx_cnf->status || __entry->ack_failures)