Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4025810rwr; Mon, 8 May 2023 01:29:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52Yxnvhuk811XfK+bdy9F6aCYCYxc6bmWAGsgwDLOsu7nVFErtVC47nD7Dg9ymDOgeG+bE X-Received: by 2002:a05:6a20:7288:b0:100:d5dc:3b03 with SMTP id o8-20020a056a20728800b00100d5dc3b03mr816824pzk.42.1683534581994; Mon, 08 May 2023 01:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683534581; cv=none; d=google.com; s=arc-20160816; b=Op39XEGL2ysW0x0uGTYLvVb7D1dj0oZYLWPzO2iUsVOpiA7La6RodVJBdZ2ccavLUj L3+q1/lIOeGeh4b/6wObio+JN49AM53nRKw8GsSncrR3b6TcDXktn8Q7E1RXxZiFN2oW 0FKbD6iWNtV9TcMZEvw3ZEjKPV2s7VM8vw9T6HxuI3MvRP+14jGQumBOLHSKBUYylSKr Wu4METm0hmI6K6m6ZnbnOc+dJDvXObK+9MpKxtYfOqBFXHOnpWI/xUJycbj6STXnAnv7 tYgWaNLcGnUOgHcf2KAbuHPA2RAHIyqU3YHnjCOjfBnBu+zj7ipCktioHMpGu618LSiB 6UtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6M179nLgsLpKyNcoHgFenXT6yJZoh5+EgSvzHkDvz7w=; b=LilSu89DRU+A0iXfg2Yab0GVYc5Y+p33LrWMceGaCHEI80GsLAyiLgTse5oQA0Njfo 4A/aUdczBGlGC4lMnJ332XBTA7i4OftC8DKbriYIPaLb4nMv62M/On2JowFc/u2uI3hp DhNCh2hMAGrW7VRpi32pEgXYP1xH5q4eZF22lx/zLYO3h0mKFshSCmeWS25XOz7q1nOg sxs8WnQFOPf3dyWk7EzDQA+20n0TM8mzNzWwxYJeLQhF0IszCXaND3KHV2SdbCOKaKEI 6CypcBUT3CPP9JUoI8XxyzaLGP3RE7v4pTsWJHgYLgohvTxhXm2No3vV9g+7Ap8sPa3O uykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LmhDWH3d; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a63350b000000b0052c6b9b185esi7538111pga.86.2023.05.08.01.29.34; Mon, 08 May 2023 01:29:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LmhDWH3d; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbjEHIZb (ORCPT + 61 others); Mon, 8 May 2023 04:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233361AbjEHIY7 (ORCPT ); Mon, 8 May 2023 04:24:59 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F02E91C0F4 for ; Mon, 8 May 2023 01:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683534297; x=1715070297; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+JkSkfvkv1cXhhzvR1efj36ToSOCv287MVFFsp3NKOQ=; b=LmhDWH3dl0PuZnj8FMZWGFAeh6xQkifKbRidDVocuC9MLt1VIRt2lUwd +rXzbnNEbt4q9DDVmgnma2B9sMJFlCy7+qOHBzXi/CJjbjIz6ZkZXbBb7 edwyXIQqyusT1HnvuLHAPeYrx2TZL3CAVo8bxeWxTKqq4xhOiMW4F226h D6gwJOTz1Cr3yGAomu5TAshgJOc1swAkMz1kmmeyHKr0bPYWsckB6ILf+ 44X7o8CfnjXcuPil54/e09gTkpWtpydpbCLPqODQD/Ypl3eZ+AGcJi5HT An5zNT0UfmWF6ycXec7lLg56oy411JxxRq/yXtnv7jOXA4WJoLm3LsOtQ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="329949879" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="329949879" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 01:24:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10703"; a="767982623" X-IronPort-AV: E=Sophos;i="5.99,258,1677571200"; d="scan'208";a="767982623" Received: from shemert-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.lan) ([10.214.224.248]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 01:24:56 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 06/14] wifi: iwlwifi: mvm: don't double-init spinlock Date: Mon, 8 May 2023 11:24:25 +0300 Message-Id: <20230508082433.1349733-7-gregory.greenman@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230508082433.1349733-1-gregory.greenman@intel.com> References: <20230508082433.1349733-1-gregory.greenman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg We don't need to (and shouldn't) initialize the spinlock during HW restart that was already initialized, so move that into the correct if block. Since then we have two consecutive if statements with the same (though inverted) condition, unify those as well. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index f877be850589..19f1545b3c7e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -667,15 +667,15 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ret = iwl_mvm_mld_alloc_sta_links(mvm, vif, sta); if (ret) return ret; - } - spin_lock_init(&mvm_sta->lock); + spin_lock_init(&mvm_sta->lock); - if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) - ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta); - else ret = iwl_mvm_sta_init(mvm, vif, sta, IWL_MVM_INVALID_STA, STATION_TYPE_PEER); + } else { + ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta); + } + if (ret) goto err; -- 2.38.1