Commit beda2554 authored by Johannes Berg's avatar Johannes Berg Committed by Miri Korenblit
Browse files

wifi: iwlwifi: make iwl_uefi_get_uats_table() return void



This sets both fwrt->uats_valid and returns 0, but in the
static inline it returns 0 without setting uats_valid,
which is confusing and the iwlmvm code misbehaves in this
case.

Since it already sets uats_valid, just remove the extra
return value.

Reported-by: default avatarBjoern A. Zeeb <bz@FreeBSD.org>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250505215513.e981a7911228.Ic94b5e03e2053a08b84cabeb58ce3b6598fd9fc6@changeid


Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
parent f2142215
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ static int iwl_uefi_uats_parse(struct uefi_cnv_wlan_uats_data *uats_data,
	return 0;
}

int iwl_uefi_get_uats_table(struct iwl_trans *trans,
void iwl_uefi_get_uats_table(struct iwl_trans *trans,
			     struct iwl_fw_runtime *fwrt)
{
	struct uefi_cnv_wlan_uats_data *data;
@@ -419,17 +419,12 @@ int iwl_uefi_get_uats_table(struct iwl_trans *trans,
	data = iwl_uefi_get_verified_variable(trans, IWL_UEFI_UATS_NAME,
					      "UATS", sizeof(*data), NULL);
	if (IS_ERR(data))
		return -EINVAL;
		return;

	ret = iwl_uefi_uats_parse(data, fwrt);
	if (ret < 0) {
	if (ret < 0)
		IWL_DEBUG_FW(trans, "Cannot read UATS table. rev is invalid\n");
	kfree(data);
		return ret;
	}

	kfree(data);
	return 0;
}
IWL_EXPORT_SYMBOL(iwl_uefi_get_uats_table);

+4 −6
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ int iwl_uefi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value);
int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
		     u32 *value);
void iwl_uefi_get_sgom_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwrt);
int iwl_uefi_get_uats_table(struct iwl_trans *trans,
void iwl_uefi_get_uats_table(struct iwl_trans *trans,
			     struct iwl_fw_runtime *fwrt);
int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt);
int iwl_uefi_get_dsbr(struct iwl_fw_runtime *fwrt, u32 *value);
@@ -368,11 +368,9 @@ void iwl_uefi_get_sgom_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwr
{
}

static inline
int iwl_uefi_get_uats_table(struct iwl_trans *trans,
			    struct iwl_fw_runtime *fwrt)
static inline void
iwl_uefi_get_uats_table(struct iwl_trans *trans, struct iwl_fw_runtime *fwrt)
{
	return 0;
}

static inline
+1 −3
Original line number Diff line number Diff line
@@ -63,9 +63,7 @@ void iwl_mld_get_bios_tables(struct iwl_mld *mld)
		/* we don't fail if the table is not available */
	}

	ret = iwl_uefi_get_uats_table(mld->trans, &mld->fwrt);
	if (ret)
		IWL_DEBUG_RADIO(mld, "failed to read UATS table (%d)\n", ret);
	iwl_uefi_get_uats_table(mld->trans, &mld->fwrt);

	iwl_bios_get_phy_filters(&mld->fwrt);
}
+3 −4
Original line number Diff line number Diff line
@@ -511,11 +511,10 @@ static void iwl_mvm_uats_init(struct iwl_mvm *mvm)
		return;
	}

	ret = iwl_uefi_get_uats_table(mvm->trans, &mvm->fwrt);
	if (ret < 0) {
		IWL_DEBUG_FW(mvm, "failed to read UATS table (%d)\n", ret);
	iwl_uefi_get_uats_table(mvm->trans, &mvm->fwrt);

	if (!mvm->fwrt.uats_valid)
		return;
	}

	ret = iwl_mvm_send_cmd(mvm, &cmd);
	if (ret < 0)