Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7565815rwd; Tue, 20 Jun 2023 03:08:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lLoBPZMwdcB+cMTX8wgivjhm6GuCGh992oRo+7lA9/fUspa7lDkdvPXzpcAt1oX7t/KMc X-Received: by 2002:a05:6a00:1ace:b0:663:7f46:a7e1 with SMTP id f14-20020a056a001ace00b006637f46a7e1mr14412492pfv.19.1687255734561; Tue, 20 Jun 2023 03:08:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687255734; cv=none; d=google.com; s=arc-20160816; b=0PVCOOnzjClYduLLbZc93eQE943NxcZ9Pn2yGjw0jOdPnDEs9hPhQ4ehyYJXn9wxWS bjqpNszs2+ql2jDNsQCv65mfvOSUHlSww2CN+FmPtcoH+MQVP4+dkSv3neRw7hwzDHB5 AuMHJ8DOVgUQN+L3nWtBwxo97OyJ4Qdos9bL4Q+VEmRk1yXMlf477QZ8xDi86ArBTJdL 4FTFzEyBzCDTTq91AIXAmM3F5k0m5MAfXqWfUgmFlgzlr94UNksGqTTVzmI5JHP0P1Q+ DB5AWsE8DemJY1jDNjVlT4eWFrDW5rV2jK0jZK1j7xoOq88k76yPPUJo4h5CZnsGGApu VRfw== 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=NxmMNrRef/aG3LIjHCiW+28PxDTPzCscTB1oq/yAt6c=; b=Cqfz0ee5uz69zACM+sQDTAuWIXiwVBOA9jayFKg5sRAuORNF9r9EFHV3bAjs5DBPiC 2TNccQYF837aKAcNkFl0krHw+oMkiGVILxAqIDb3b+V4x7Zog4l9gv1AhxqDhEeQZFaK 2wmb4YRauWhGr/2PXMk93/uUi3WrEVNKDWUgNjVV25XjLh3dgPnsLasiUcWnILJxeqgE S2OrbEp0KlRg3uDDv0E+KlvtTIIRBWHM2kC+F9DlqbaCQUxaVe/5bVYR2cpfWPsEGkLH tTp10fUADPIgJvlrhj+46d6zYbFu7M2i1yKaXPENlMRjswsqEq1JcCUgOZ8H5mCKcD5N NQUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZVH45XM6; 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 c192-20020a621cc9000000b006683174a49csi1380395pfc.198.2023.06.20.03.08.46; Tue, 20 Jun 2023 03:08:54 -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=ZVH45XM6; 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 S231805AbjFTKFE (ORCPT + 59 others); Tue, 20 Jun 2023 06:05:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbjFTKEk (ORCPT ); Tue, 20 Jun 2023 06:04:40 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A13F10A for ; Tue, 20 Jun 2023 03:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687255478; x=1718791478; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MmYfxIqr99KMnXM6VI3ZDp89DhhLHh4P8n783TZGI2E=; b=ZVH45XM6dbkTwmCPiNILocq9E6zOSgvE73LwCxlVUVSs52iCw3pator0 jYwrJfCo65W+f6JxyM3sogJP8Q9qYHNZj74hZvJ5dR4G9XBlHXNAeKA1u HCeYo7FvGwlOZSZA1UDJfprwjOUGgHpt2RPT38HsYIudhs+6JPD5B4MGM ZE5vquKMuMOlRxLejdXPYnQzKiOQ2BZkB8OZmrpM5fx7kGjoWJQpgW8jO t1AkvrcmTVkGluRVQCeWoey7Y8giKjNPAgSxwBCXo5TG9YzbPZtF0ZpSt 7jlr+jSRWTLE0JJepjF9yRLGhekrgpNkhLBse1NzbBnothEIMQiSdJInI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="359819598" X-IronPort-AV: E=Sophos;i="6.00,256,1681196400"; d="scan'208";a="359819598" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2023 03:04:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10746"; a="838143394" X-IronPort-AV: E=Sophos;i="6.00,256,1681196400"; d="scan'208";a="838143394" Received: from rafist-mobl.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.214.208.68]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2023 03:04:35 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 08/19] wifi: iwlwifi: mvm: use min_t() for agg_size Date: Tue, 20 Jun 2023 13:03:54 +0300 Message-Id: <20230620125813.211768036c1f.I78b7eea32eaae20cc9f32869aa3f42814634ce9a@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230620100405.45117-1-gregory.greenman@intel.com> References: <20230620100405.45117-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,URIBL_BLOCKED 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 can use min_t() for the agg_size and avoid spelling out the (firmware) limit twice. Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index ff1ce990a9d8..3c24b25fe661 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -92,9 +92,8 @@ u32 iwl_mvm_get_sta_ampdu_dens(struct ieee80211_link_sta *link_sta, IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK); /* Limit to max A-MPDU supported by FW */ - if (agg_size > (STA_FLG_MAX_AGG_SIZE_4M >> STA_FLG_MAX_AGG_SIZE_SHIFT)) - agg_size = (STA_FLG_MAX_AGG_SIZE_4M >> - STA_FLG_MAX_AGG_SIZE_SHIFT); + agg_size = min_t(u32, agg_size, + STA_FLG_MAX_AGG_SIZE_4M >> STA_FLG_MAX_AGG_SIZE_SHIFT); *_agg_size = agg_size; return mpdu_dens; -- 2.38.1