From patchwork Tue May 12 15:04:03 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: 215626 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, URIBL_BLOCKED, 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 D536DC54E4A for ; Tue, 12 May 2020 15:06:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACBDB206D6 for ; Tue, 12 May 2020 15:06:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="POBDwHtw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730640AbgELPEy (ORCPT ); Tue, 12 May 2020 11:04:54 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730014AbgELPEx (ORCPT ); Tue, 12 May 2020 11:04:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CQ8LR9Wxzylc+ZlVTScLFQR/3GkLyexqMj+JQZ0iBrnxTCsKl8ytN3dTpV4H8xYa1JtdBJK+FsXnNPAIy3VJ8oqa7S/QU4uYBXLl2mfno1/bomaYCXz7m6RaUnYesuW9G9WcEniCLJH4uclgBTstl2ipaa9uQ99j0vBePwe/BIqZXEPlIJDQJmx//i3tX9rrovLfuM0O6nQ+XWh+YdiCG7zRUmuWsXToZmH4tWrbAIIzvyN2Y8SjJQKbWKY6c4po7TQ+sH6T6t9dZi9dtG62EL9zcBelCMbHOTTkBbMDpQ6fXOpJA7ltyD1oxF3qpsGi+OFdchWLZS5MBvHLqtiTrA== 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=BsrqIiAK3fP6Rj2M8OowayKr2IPJCkCcjynA6nrf4EFu+E79LZYLccBupShhG7VARXG0A4WBtJMQSDZY0KckybuH2t7zm871MEQ/iAdy4dynQsVXUBtoiqleJPKf3i0mgUcXT5Mgx1yywGtzKW5S3Z7uU0j+8/apx14oOABHC/c7z0WZVN7vwIeDn33vCE1/gL7pRGk1J8h7PcMHdlNz7AZCmXogam5V8Y/KE5gKimZkznJ4lHNjdPA2oWJked7OAUbVQ4Vw25kRi9+HV0oS7JPWVTUD9+X8RwtJqDKfmHLTP4AM/9v1ZRtjm1Gd9LiFMjV5HtN2v2sxO51L6vj3Rg== 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=POBDwHtwW9YOeOkVclDKJORgnxa3dYSVkTrvQVdCWRLD4jQeDX9o9DyXC4hTxbfQJ+tOLmhETg9zzlO0xQu+IFPw490dbWCMIUIsFmd12gfxlTAs1FkX6RGxMdhCjByC6wcia0qDY8zpBt4s/73TdBQOhGNd4+WVHKZAx8SNsh8= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:42 +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; Tue, 12 May 2020 15:04:42 +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 v2 06/17] staging: wfx: fix endianness of fields media_delay and tx_queue_delay Date: Tue, 12 May 2020 17:04:03 +0200 Message-Id: <20200512150414.267198-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:40 +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: 358d58a5-fc04-4a41-2932-08d7f685cc67 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DkvCq8jaRN+MnzxAoGN1mRwaoJNccfdqMFQiOd3LX0A5k+3xdONdeQ+ttt/iKh5Anckf0s9tk/YGmtvrR7UNqf3Df9ajh8Xl9+tiweZrwBBlKqvl5MOFVW37RHNeiSHGxO7pLqMZ/3nnal6dXt1IJ4YBm5X+/JNkswYYmE5O62U8/rm7UAu/unGhZ/KEvYGh770iWZFmrfJFj/WBueV/0iEKoBPos7/6wPFq77QtgKpBlP4+6QnAl1MjLh+LL2SpnVb7tKafSgYCgLvJOsXHBM9DpoJwPYTp3njsyiiO/z4kOe3pBw8b0BCuTjhbbns9zrOfqrugtQxeIt1/FnrWCWCHZpi9r+/NxO/29zaciNexXdjkvT68gf0VLQxpGrjvWJhCIwsSWpAWwnIDlcxMTzAmhOSeovD/wWAiPns7QlzKasQ+2RI/+mbeWjIALKAgoEZcpBcpqPUshAiBFMcTarqicBW0HervySUI5FmnlLk/QOL5fl3JSxVP7cdEDWA54I6pPNiCSs1pKT2yUzlUZg== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: a/zbgdRfl769uim8e47pd3oPgEyBbeqy5ORUUfBq/ii0wbpEpjn+l10uEQnm5iGVh7NLmVx8p4Xu3qa46B9w4hT7glSn7biGjPzJOWykQNsrUhruykqSD5sMPAKrA9qcgqWfC425glO92jYH70lEkKh+MDzs3KTK3qX2ROGRfJVrls2WyxtvxhfhIKYt7r+J4UDY3w2ada/nnKiruOOCVH64zMjkadKOtW0ugoTfaKeYZ7I6FjKiTpj/kVWUqOLtNVMqu/9rxFh6gzp2gmc/KaMafGY8HhFaYreedRGpJ9vYQ7J4vOnUSoTX85D/WwHPCZzfC1+bSTddQ1rBd5dFGzjGeAzt4AH6RAUU4CgznJfDaGDogwwOk4TZdzksPS0Ks0/BVTm7jf/Qn1qrDHKh5nUlqusPdr+d+cmExIfGILhASj3jlJXDB/WEmQjN0BrRwAFtMYNWWC86WnNGwb4u63RVWtsfw2mHrmBT1nvbnBE= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 358d58a5-fc04-4a41-2932-08d7f685cc67 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:41.8749 (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: S6/5EhbQQdSjxJWpNNMG2GkeBDtbDJgBkLEhvO8coMHI+OUCnIL6gxXUM7SPrVbb/4XpYvHgHyGg/qH1d8uztw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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)