From patchwork Fri Sep 10 16:04:41 2021 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: 509049 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham 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 0DD6CC433F5 for ; Fri, 10 Sep 2021 16:07:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB6BB61207 for ; Fri, 10 Sep 2021 16:07:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbhIJQI2 (ORCPT ); Fri, 10 Sep 2021 12:08:28 -0400 Received: from mail-mw2nam10on2056.outbound.protection.outlook.com ([40.107.94.56]:59105 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230020AbhIJQHj (ORCPT ); Fri, 10 Sep 2021 12:07:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V3vHf3ut3eefhxr7ydv28Z7S9jQ8FeLXfinXVIxGg2Og1x5bbW/gth/dl9qAyHh9uzAx/eTM3a7zowDqjEHkxKdh4VL5H97tDdpuDAdR7HXbIBMNNaDGCZJ/hWILn6KbQfYcAhita7qm7YHseuT+IodGMC5rngGQfvpK6h3jldqt//yQ5C2E0m9NywDAI2vc21CqViZAD47UET6G/PiG4BhS9kSb91+k4CKw26WZzT1PbzbfEWfNggIEV066aoVL8s6hzYXic1m4L93d7/tmcqVkJrL84UM7FGqimuCEHO4QBAzutcZzcSlsZe6NE4nRCTpZSQVmrtNl6fVZ3i1cZw== 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; bh=ukiiaXuHB68lNESJa7s+KPhr2UdHv8KEhL2rJ3/GeVg=; b=f5BaNKkAiTZ5UJUGdreFlvsi0zKbOk+4L5A3HgvwSG56xJ7whJYjg1wwIvUWX/KEJdDLGcDvTeT/0xCjad0/tfsrQqyjh61ItYPU7yv90omZKwrk7XprQRyz7dXx0eTzVMexsHlujbilLfP/DC46cwGChyroJxGnWpPl61zAbB4jDxBowcSccvRotNq9O3daYNVAfpcF4H+UNWyyPwuHhPSznmyAocyzPSulw84+A+ppD5o08c5k5JQyLNcen/My0o4XiwWqUWkNzsEN3YddYSNUEg9nlJz6kJNdOoHylVbbME//a+S8PDAWMQrgtyUl7EN6HZ7NlpbMRvcE8pD5nw== 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=ukiiaXuHB68lNESJa7s+KPhr2UdHv8KEhL2rJ3/GeVg=; b=pmpmIs51LvxFh2xlhLXsBZ+WyB5j7pRXtFvuDhj5l34G4vvGHxsdkaUheCnj3yvZa1K0ajNXUOUESWybm2oRMdSkbycbNKv6BYy0f4hivZsxGKk+k61a2vFN+/CdHejtQ15FtYm95cHp5+kBLYb6tkSywOLw9MQs8TBkEE+0oZw= 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 SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SN6PR11MB3118.namprd11.prod.outlook.com (2603:10b6:805:dc::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Fri, 10 Sep 2021 16:05:48 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Fri, 10 Sep 2021 16:05:48 +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 08/31] staging: wfx: take advantage of wfx_tx_queue_empty() Date: Fri, 10 Sep 2021 18:04:41 +0200 Message-Id: <20210910160504.1794332-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> References: <20210910160504.1794332-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (2a01:e34:ecb5:66a0:9876:e1d7:65be:d294) by SN4PR0601CA0006.namprd06.prod.outlook.com (2603:10b6:803:2f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15 via Frontend Transport; Fri, 10 Sep 2021 16:05:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c446094d-4ac6-466f-f288-08d97474da9d X-MS-TrafficTypeDiagnostic: SN6PR11MB3118: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:549; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0/ImssbpQMfV3VhWVOggxqv3oglZRa72FhtAh0gaCunjWYn90uT+JHzrTGC/IQOoSgOK8fW9CWclZDkSzJIj+DXk5Gf8g5L5tiVEcP/T46pNfWI6uz8xaXirmqkyi93zGsuiUaGfKsou3cdvUBO+C/CRWoAF5TuZGNmg4oYse6X0XIt/by4bn+0/DksjmsOIvXSQLDoTzqzwr+U0sY8r9U/EmgsSy56CDW+T4bGIv2S1PBX68Sth4sKOcgIdD9r+FISHxLF55UlHUXq1OSkXDmaMA8akcr0Q8I4o5sqb/mSFnE+Bor/cB34bDU3AlkWwk29rPI55hbnQgO5a/ustkkeK25jdbEnwaA9CEz873j+jLPu+z96oXicmnHLFWAzUSvbb4pL3rHgHySXhJBFyxchYOZF8NdCfV7WUZt7M0SEXGxHVSXZRuKRGdR8Vorzm48s0HTQXtIsyYASRZDSULP5c7L47CpfU2US1sMEoq/dEAAbmWGEvrI17NEU6pme88Tp7JKyZ78SXSSX504KffdRGXZIOu/ETJwDYECQkmjsrbiRo1MiMghRrOROfkhMze90U21kv3t/L3SmAF2MGA6CQpQvcFWb00jJ6cK2gwIo8fue6Qweq5FYcgJAieAEh0ia05QhDmWuOYtZujwmtAA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(366004)(376002)(346002)(39850400004)(396003)(4326008)(66476007)(107886003)(36756003)(186003)(316002)(6486002)(66556008)(8676002)(6666004)(86362001)(2906002)(54906003)(38100700002)(83380400001)(8936002)(66574015)(5660300002)(66946007)(1076003)(2616005)(52116002)(7696005)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DvyO4PqAx2zM5afKuVbazA/GS?= =?utf-8?q?LtPkmYt7+HUCR+s6pY18COWyxem07OxjDxeZ8z6J9yPztXAupMJEn9+P?= =?utf-8?q?Dlmmgn88f26+6NekzOIbLytmTJ3BXTkMGI7FKzaYbX8L5Wcz4fU7d9q1?= =?utf-8?q?pRZoA/E1yf/XB6NVsbVBJpP5VFmbuJjZUhUuNijggQWwapQCJyD+rEML?= =?utf-8?q?FVvrX3HjMzymSiZikmdb+LvOlAMlJIWyeAs4LhMXgLtd3if3W9uADQKm?= =?utf-8?q?VHopJsAY/5Jsv07mE8L/TMp4Oa+d5a/NhTdAap/LifXqQ3Cn3d+do0pG?= =?utf-8?q?DOFC5tE5Pi/TtHy8OZaD5NGhP1EaqcKFMrzqgsOqFVSO+O6glkgd29Q0?= =?utf-8?q?4PV2xZQHPHxRaKxrPx4SKMEWXYCOyv4vtDsN9wvGZIyWyNnqQSd8R4HD?= =?utf-8?q?kDHERo0Zl/JDfQ3MgZjF3uRrKyNkaX3bc6x0PMyfEIi8/sChIheiF0UW?= =?utf-8?q?jTWXALRrneYtPRlm+zx9OpD4Ua7Z01/LKeMDAbo8HRpXG7bIElkAq5rp?= =?utf-8?q?iNvtC2h29ALK0GsrqEbF30AR7UZIkQMMLnZwgicpziNae/1rtpG/qpKI?= =?utf-8?q?VM4KgPHIbQBqnWXjg5yiUhgpxZQARw6/LKnQPD5TSTG89fPp0M5Hcmf8?= =?utf-8?q?oyH6vtnMGr56Z9Jdw9yA43HCrDt4tFWFkb62120UXu675sw78jhMDmon?= =?utf-8?q?DB2RRhHNE8U106hZHsVa/+9Cwa8kBxNwqiXzg637vZ0awFdvyQSd9vsv?= =?utf-8?q?5fiCTzTV5GpSvpXmFVG/pbie+XaCJIo/+BgnAc6PC8Ku8bgqCmB5lBPT?= =?utf-8?q?gPwS4uit3cYm6HxUI77JWZnl4+Mdf/EBPI+oGYpEOHEv6DaqZINhRzmk?= =?utf-8?q?dH+xFgD5BBMGdgucyBC3In45zsVPv5Bx6D8CTvTexSq4DhTHgB/+wvPQ?= =?utf-8?q?aoNhfjNrTdbqa4iRcUUtTz2npXgZPhH14swnhXz1XxaYGZhh2N+77Shq?= =?utf-8?q?OLSetlr/n4BNWJPS87xvSzhwNMn+DJXUeUOWLoX5sapH2/F+bIopItmR?= =?utf-8?q?T+TjoFYAhDMd8z4YJ5BEUlHuABcs3HSbcewOBkAzz3RIvQj1OEOGj6H0?= =?utf-8?q?BX4+6fRUKrdwn0UNHXIgGn8QpHmA4LpE0X+iMgK+CQz1OAMZnq8X+nm8?= =?utf-8?q?mS8LELFztdlykSr46SVjV+RBZBhglVxSd87cIK6fn4cOPvxMwzcn5kKh?= =?utf-8?q?eco4pzs8w+arha0T5VEGw3id2zVEeJU/TLkXwOS6E9XLKjfKq36axmA8?= =?utf-8?q?qXQbmDlf5fhmNTGL+eAINmOFHN+lc7wUdnsznaJNfdHOG1lYTfx4L4fY?= =?utf-8?q?U3+EiTK4218bkoL5NtQeGdMyh06COnPBk/DkmBN+xjffVklGNdNk47LF?= =?utf-8?q?19c64vXP1rkJz0hHCPx02lrREFcitClm5H0nPml?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c446094d-4ac6-466f-f288-08d97474da9d X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2021 16:05:48.4887 (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: o4rGFY64e8izhFBGnmiWYdqkmmgkAh3c/CWpnImrecEfBJsehxOpsGnc3F+/zsVpVWSSemGEM/zn5kKi9qZc9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3118 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_queues_check_empty() can be slightly simplified by calling wfx_tx_queue_empty(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index fa272c120f1c..0ab207237d9f 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -73,23 +73,22 @@ void wfx_tx_queues_init(struct wfx_vif *wvif) } } -void wfx_tx_queues_check_empty(struct wfx_vif *wvif) -{ - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - WARN_ON(atomic_read(&wvif->tx_queue[i].pending_frames)); - WARN_ON(!skb_queue_empty_lockless(&wvif->tx_queue[i].normal)); - WARN_ON(!skb_queue_empty_lockless(&wvif->tx_queue[i].cab)); - } -} - bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue) { return skb_queue_empty_lockless(&queue->normal) && skb_queue_empty_lockless(&queue->cab); } +void wfx_tx_queues_check_empty(struct wfx_vif *wvif) +{ + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + WARN_ON(atomic_read(&wvif->tx_queue[i].pending_frames)); + WARN_ON(!wfx_tx_queue_empty(wvif, &wvif->tx_queue[i])); + } +} + static void __wfx_tx_queue_drop(struct wfx_vif *wvif, struct sk_buff_head *skb_queue, struct sk_buff_head *dropped)