From patchwork Mon Sep 13 13:01:47 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: 510227 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, URIBL_BLOCKED, 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 2B05FC433F5 for ; Mon, 13 Sep 2021 13:06:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15ED460E9B for ; Mon, 13 Sep 2021 13:06:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240204AbhIMNHx (ORCPT ); Mon, 13 Sep 2021 09:07:53 -0400 Received: from mail-mw2nam12on2088.outbound.protection.outlook.com ([40.107.244.88]:10209 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239312AbhIMNFZ (ORCPT ); Mon, 13 Sep 2021 09:05:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YRgG63c4iowjpuW3/KzFK6NxYP1uWrKHTVUrwvKv55uYq9CPZchwuBcF6Op2SqWvMcmGy01KMNVULjBKYKYZVPK6Ykm43Z67g0yt1DYFgu20oRisVReBM6zxNNmjrVQrm8Xp3nbPZNSwCSr2Q9A8kvNS/8+RKfpDb6d/mjWH47OTNUgPRsDW0xU/T5cmfhS9+GUGeP283nhxdXcKzwQb9fkLtztenSWTmuYkkng/KJtL4YKEMjR179HESMq3RF3Uu5aFso6UYfu5awsDD1ZKZuBZ0K+Ha9TfaoesZOaH1ECAW01JPCwUBXZhw0Rv4kO+GnM2SN01/eTczMPiyk3qzQ== 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=dzwEfQZKRI3oV247NU8V2xMOFhCemH5anBJ8Bdc6bfM=; b=av5L6wwirrnktUofTSQT1xvOUCikxDKCWDIz/TObtEPACtF6H7v9cIR+PeQm2OU/KU8vui17Qmutng0W6gA7GpQlcpOJ47wnLM+zJs/IJBHhaBsCPV4nPS1nAQ0UlMNbm+Iyj0C8HaO76UVaDuGLeYUmxJpZpXMhfcM7kgNDfTQ8WkMIuzfI9CQ0hsR8fKb/xsoXlaPZl+vh+/pr4VCM6PDo3uBV03DP/IcGOOWUej0084Z2IJhBSfuazhaigissTz9RtT77O/pCAJtAtMlyTKVuYPL6nx+pxvQ+uJ5tBUSflz5NCPZeTxnR13BSxLPh+LEuo+o19c41r/sAvWwyqg== 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=dzwEfQZKRI3oV247NU8V2xMOFhCemH5anBJ8Bdc6bfM=; b=HPd1nMwgkSIuWFbg6cmi/JlLxohbBM2dR+ma5GRx32u5nIh3OXbx7bRzipIndBl/QUHgDG6GeZZ86TbrpHzokfyDkVkirs1KhC3ZV8crwDCiJD3m2pUjsgSsOul0hQUmr8unW+khdHc3xtmOaKsXhdkZy5AcoRBmhRuzJBrXIX0= 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 SA2PR11MB4860.namprd11.prod.outlook.com (2603:10b6:806:11b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 13:02:47 +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; Mon, 13 Sep 2021 13:02:47 +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 v3 16/32] staging: wfx: declare variables at beginning of functions Date: Mon, 13 Sep 2021 15:01:47 +0200 Message-Id: <20210913130203.1903622-17-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> References: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (37.71.187.125) by PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 13:02:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8bc80ad9-17d1-488b-a9ac-08d976b6c858 X-MS-TrafficTypeDiagnostic: SA2PR11MB4860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vr6dfzs8y+LxmxbbULt0S3j73It0G8MOJW8qHC751shYzO5YONksOs5R5yHr6lPXS0wo5S2mg025OQnX1DTseA0vUpIzec1c/NQ6MHgMW2/YGdNfZ9wURVYkggUY/7Oez9wtSkJsMA4NCSjkfn/88vwzDOdh3pWb67fwU3M42wV2C6W1CfuM2Q/hI7LfpRsbDdrmv4PBDmP8LPfZVZ/MfXfANyNaaE3zsiymuhGfkCRi0pc15VjoEo0Cixtkqt0F0l0SS2MivGk4cYfG74hGBUcFw6Fl0syUMTuuQ7K3WL/JIdpc7G0qZsFmuGbwMP+jcP6PwE0OR90h5MSGpv4NnZ2LDo3xmIS9pKS/zK8aIGAJ6ZYM0XR6hX8dlm5cFrpqpCzR493h8mGJpEJc3Eqh6qDUg835Q4FrDRMueXbYV8UR5rKiK9pjSat/NzJLjAg46m7ug51mqYpoNS2bx6aoYacq2q89i1XQUaiRNPjUuV720JOvVpQ8+BHdyYrgHgVYexauibgiR+2OkMJuvkfgcdUSj7ao8LxzFFBAs6Vmjp2MnBq2OHTYjQ8tFUVVyIuPhz6FbgGkPlHV8VJ/6/tyWyeiAY+JgPrkxOtLm9o+YeumjTP0U4z72OSPGMDE1S3kBOVg2E2aFoOE55ziKya1Kd2B3gOc6CJu2M4H5quyMUo3uT6UBvBJ1Vo9gkZ0e17PKqcugvbKIrUB1j2G8nubig== 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:(366004)(956004)(66946007)(2616005)(26005)(36756003)(38100700002)(38350700002)(316002)(4326008)(107886003)(7696005)(54906003)(5660300002)(52116002)(66556008)(1076003)(66476007)(6486002)(508600001)(8936002)(83380400001)(86362001)(2906002)(8676002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2i/mL46LnkUAncLp1G2oDjKTB?= =?utf-8?q?nWd96pKim3rS/d0+nCGKBsFHJwIU9d0cWLIkqHm+zZ7nxx1Dce79Tw6u?= =?utf-8?q?t58TnH1b3AU1qw54IBKA4qfXoqep3TvwLQ1g8lmEDifXd3LzB7zJGXyW?= =?utf-8?q?IMwqmrNhSFtOKoanTDOR5E9MWTUtnZE28/nEi0MHI0mzxeoghkghW7NP?= =?utf-8?q?xmt6uhOOTPzr4I9UBA8cKEZLfN/fqtl/tnKaSPK7Cua+7AmtUJPiDA7p?= =?utf-8?q?OTK4vBjVJYMlbNopACiNdU9peAUXttbS29TqyWfHbkprwIfqQjqO09uI?= =?utf-8?q?IedGPvC49ye80rNQREKNJCOwqlcJp82Lu8A66Vi+wUpxiF0pi6Wm8atH?= =?utf-8?q?fjedz+GnFLzxhtLhj6170/FLAsjubJ5FsCAt3mAv3JjNcVATS/i9/RSS?= =?utf-8?q?VwbJkNYTN9Wgj1mAQstzRgozMHTbihwjQKotvVswthmyxJw7gUtCEvTi?= =?utf-8?q?T4nyovd68u8QUm4btO/Wz3imrhIVSB1Qy3nIEcp8mityAy1qgWyXrP9i?= =?utf-8?q?mi7LYs44XMKY46VRDaKzbBozJbmYOUjhBPqOHTjZ7FvCpeHzsQlgpKO9?= =?utf-8?q?Rg+gxZpcvNZg9YznHfw7YQstj+iwgfsbme0OiT3ZrVpt+dq6WWCUjVzY?= =?utf-8?q?DToPuE3Fa20AObrxHcnj/YQbteD9ZREFnNfT83KVl4k/pDRJeGMJ0tOO?= =?utf-8?q?rVFR51KqUl5UN9zsISqGd3YVH7lehxU5qqkxJWRnvRNqDIWIrrnGIJ06?= =?utf-8?q?6evCdtV/mYrIC85eeX8/y8Q0iOm/zykXxGqjENsRPpSZ8MxXf3OvBGqR?= =?utf-8?q?VRCsAGc0Klk9oObe7mfxACNxiFkqB528J94TCKEkrQdxMDg4VevCbbFt?= =?utf-8?q?HBE5Blvb6Tt6QqZl8ImyKyxZH3l4+IOF6l3ahEM8H0AkT1CpTQDZ51rW?= =?utf-8?q?CD756JMsaLxu44n5GQSGYrYbXh/NtZYx5zvciXwcuMFDzMF5c6eUNvJk?= =?utf-8?q?Ja81FIZmvVNj+8CBkKh1P7XBthFdNnJlPTp5aAZVm5ZzbYGDRptAXqCh?= =?utf-8?q?e2c1vFMxD/afYeg8cfleXlX254AOWyesBON9fL3vVmjzzP4poeuU7OgW?= =?utf-8?q?bqGnmuBfxloYRzQiLkpP/NcxBmVEJJL8m2lCzKN+LmxQDQwlyKc4lHjm?= =?utf-8?q?Yjfq4J3r1HCCZjK4m1o6MbzwPy9RxiYbtf3l/dHKDYQ3Zj0YCZU5mh62?= =?utf-8?q?oeT2NClmmGzkXGz0s1EG56gtzvfoyhy8Wbi0IFR7HjTLAlOy0zPYZawJ?= =?utf-8?q?GgiptvpU9uqjAhZYyXZjkzkwvdt2mkge5qtMEdFa1VjA/CvEpiq9o7FN?= =?utf-8?q?49IcQd8wKSnscis5jwn9FsBjzjj9uwO?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bc80ad9-17d1-488b-a9ac-08d976b6c858 X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:02:46.8424 (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: IY+0GqnpkmfzLF+NxEvNB/Ssyn/49hpwQAR1BuQ/F9LcnE0kxf/ILvKYfpYlC8quY9Yxa3I87ktURH/acn1DjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4860 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller For better code, we prefer to declare all the local variables at beginning of the functions. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index caeaf836147f..00c305f192bb 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -108,6 +108,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, int idx; struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct tx_policy wanted; + struct tx_policy *entry; wfx_tx_policy_build(wvif, &wanted, rates); @@ -121,11 +122,10 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, if (idx >= 0) { *renew = false; } else { - struct tx_policy *entry; - *renew = true; - /* If policy is not found create a new one - * using the oldest entry in "free" list + /* If policy is not found create a new one using the oldest + * entry in "free" list */ + *renew = true; entry = list_entry(cache->free.prev, struct tx_policy, link); memcpy(entry->rates, wanted.rates, sizeof(entry->rates)); entry->uploaded = false;