All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 13/15] iwlwifi: remove iwl_validate_sar_geo_profile() export
Date: Sat, 26 Sep 2020 00:30:51 +0300	[thread overview]
Message-ID: <iwlwifi.20200926002540.9e2f296f5cfc.I4b2c025768b5ceff93a80ba0ae9ee7784d6d7402@changeid> (raw)
In-Reply-To: <20200925213053.454459-1-luca@coelho.fi>

From: Luca Coelho <luciano.coelho@intel.com>

Only iwlmvm uses this function and it's so simple that it's clearer if
it's spelled out in the code anyway, so remove it and add the check
where needed.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 17 -----------------
 drivers/net/wireless/intel/iwlwifi/fw/acpi.h |  9 ---------
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c  |  9 ++++++++-
 3 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index b14260e303b7..e3de4e11f4ae 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -631,23 +631,6 @@ bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt)
 }
 IWL_EXPORT_SYMBOL(iwl_sar_geo_support);
 
-int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
-				 struct iwl_host_cmd *cmd)
-{
-	struct iwl_geo_tx_power_profiles_resp *resp;
-	int ret;
-
-	resp = (void *)cmd->resp_pkt->data;
-	ret = le32_to_cpu(resp->profile_idx);
-	if (WARN_ON(ret > ACPI_NUM_GEO_PROFILES)) {
-		ret = -EIO;
-		IWL_WARN(fwrt, "Invalid geographic profile idx (%d)\n", ret);
-	}
-
-	return ret;
-}
-IWL_EXPORT_SYMBOL(iwl_validate_sar_geo_profile);
-
 int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
 		     struct iwl_per_chain_offset_group *table)
 {
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
index 39e6be21158d..56f3399fe99e 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
@@ -194,9 +194,6 @@ int iwl_sar_get_wgds_table(struct iwl_fw_runtime *fwrt);
 
 bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt);
 
-int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
-				 struct iwl_host_cmd *cmd);
-
 int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
 		     struct iwl_per_chain_offset_group *table);
 
@@ -278,12 +275,6 @@ static inline bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt)
 	return false;
 }
 
-static inline int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt,
-					       struct iwl_host_cmd *cmd)
-{
-	return -ENOENT;
-}
-
 static inline int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt,
 				   struct iwl_per_chain_offset_group *table)
 {
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index ce0e0ff6193d..f76ed9d10af3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -770,6 +770,7 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
 int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
 {
 	union geo_tx_power_profiles_cmd geo_tx_cmd;
+	struct iwl_geo_tx_power_profiles_resp *resp;
 	u16 len;
 	int ret;
 	struct iwl_host_cmd cmd;
@@ -800,7 +801,13 @@ int iwl_mvm_get_sar_geo_profile(struct iwl_mvm *mvm)
 		IWL_ERR(mvm, "Failed to get geographic profile info %d\n", ret);
 		return ret;
 	}
-	ret = iwl_validate_sar_geo_profile(&mvm->fwrt, &cmd);
+
+	resp = (void *)cmd.resp_pkt->data;
+	ret = le32_to_cpu(resp->profile_idx);
+
+	if (WARN_ON(ret > ACPI_NUM_GEO_PROFILES))
+		ret = -EIO;
+
 	iwl_free_resp(&cmd);
 	return ret;
 }
-- 
2.28.0


  parent reply	other threads:[~2020-09-25 21:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 21:30 [PATCH 00/15] iwlwifi: updates intended for v5.10 2020-09-26 Luca Coelho
2020-09-25 21:30 ` [PATCH 01/15] iwlwifi: dbg: remove IWL_FW_INI_TIME_POINT_WDG_TIMEOUT Luca Coelho
2020-10-01 18:57   ` Luca Coelho
2020-09-25 21:30 ` [PATCH 02/15] iwlwifi: dbg: add dumping special device memory Luca Coelho
2020-09-25 21:30 ` [PATCH 03/15] iwlwifi: regulatory: regulatory capabilities api change Luca Coelho
2020-09-25 21:30 ` [PATCH 04/15] iwl-trans: move dev_cmd_offs, page_offs to a common trans header Luca Coelho
2020-09-25 21:30 ` [PATCH 05/15] iwlwifi: mvm: split a print to avoid a WARNING in ROC Luca Coelho
2020-09-29  7:52   ` Kalle Valo
2020-09-29  8:09     ` Luca Coelho
2020-09-30  7:31   ` [PATCH v2 " Luca Coelho
2020-10-01 18:57     ` Luca Coelho
2020-09-25 21:30 ` [PATCH 06/15] iwlwifi: mvm: Don't install CMAC/GMAC key in AP mode Luca Coelho
2020-10-01 18:58   ` Luca Coelho
2020-09-25 21:30 ` [PATCH 07/15] iwlwifi: mvm: add support for new version of WOWLAN_TKIP_SETTING_API_S Luca Coelho
2020-09-25 21:30 ` [PATCH 08/15] iwlwifi: mvm: process ba-notifications also when sta rcu is invalid Luca Coelho
2020-09-25 21:30 ` [PATCH 09/15] iwlwifi: don't export acpi functions unnecessarily Luca Coelho
2020-09-25 21:30 ` [PATCH 10/15] iwlwifi: mvm: add support for new WOWLAN_TSC_RSC_PARAM version Luca Coelho
2020-09-25 21:30 ` [PATCH 11/15] iwlwifi: mvm: remove redundant support_umac_log field Luca Coelho
2020-09-25 21:30 ` [PATCH 12/15] iwlwifi: mvm: use CHECKSUM_COMPLETE Luca Coelho
2020-09-25 21:30 ` Luca Coelho [this message]
2020-09-25 21:30 ` [PATCH 14/15] iwlwifi: acpi: remove dummy definition of iwl_sar_set_profile() Luca Coelho
2020-09-25 21:30 ` [PATCH 15/15] iwlwifi: add new card for MA family Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iwlwifi.20200926002540.9e2f296f5cfc.I4b2c025768b5ceff93a80ba0ae9ee7784d6d7402@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.