Commit 86e8e657 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho
Browse files

iwlwifi: fix various more -Wcast-qual warnings



When enabling W=3 that gets us -Wcast-qual, fix those warnings
in the code and propagate constness properly, or cast it away
via (uintptr_t) where really needed.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220128153014.4ac2f19c121e.Ied9469d93f8199206242bfba96e4e8d1949e3a08@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 73c289ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static int iwl_pnvm_parse(struct iwl_trans *trans, const u8 *data,
		u32 tlv_len, tlv_type;

		len -= sizeof(*tlv);
		tlv = (void *)data;
		tlv = (const void *)data;

		tlv_len = le32_to_cpu(tlv->length);
		tlv_type = le32_to_cpu(tlv->type);
+6 −6
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ void *iwl_uefi_get_pnvm(struct iwl_trans *trans, size_t *len)
static void *iwl_uefi_reduce_power_section(struct iwl_trans *trans,
					   const u8 *data, size_t len)
{
	struct iwl_ucode_tlv *tlv;
	const struct iwl_ucode_tlv *tlv;
	u8 *reduce_power_data = NULL, *tmp;
	u32 size = 0;

@@ -79,7 +79,7 @@ static void *iwl_uefi_reduce_power_section(struct iwl_trans *trans,
		u32 tlv_len, tlv_type;

		len -= sizeof(*tlv);
		tlv = (void *)data;
		tlv = (const void *)data;

		tlv_len = le32_to_cpu(tlv->length);
		tlv_type = le32_to_cpu(tlv->type);
@@ -154,7 +154,7 @@ static void *iwl_uefi_reduce_power_section(struct iwl_trans *trans,
static void *iwl_uefi_reduce_power_parse(struct iwl_trans *trans,
					 const u8 *data, size_t len)
{
	struct iwl_ucode_tlv *tlv;
	const struct iwl_ucode_tlv *tlv;
	void *sec_data;

	IWL_DEBUG_FW(trans, "Parsing REDUCE_POWER data\n");
@@ -163,7 +163,7 @@ static void *iwl_uefi_reduce_power_parse(struct iwl_trans *trans,
		u32 tlv_len, tlv_type;

		len -= sizeof(*tlv);
		tlv = (void *)data;
		tlv = (const void *)data;

		tlv_len = le32_to_cpu(tlv->length);
		tlv_type = le32_to_cpu(tlv->type);
@@ -175,8 +175,8 @@ static void *iwl_uefi_reduce_power_parse(struct iwl_trans *trans,
		}

		if (tlv_type == IWL_UCODE_TLV_PNVM_SKU) {
			struct iwl_sku_id *sku_id =
				(void *)(data + sizeof(*tlv));
			const struct iwl_sku_id *sku_id =
				(const void *)(data + sizeof(*tlv));

			IWL_DEBUG_FW(trans,
				     "Got IWL_UCODE_TLV_PNVM_SKU len %d\n",
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ static int iwl_dbg_tlv_alloc_trigger(struct iwl_trans *trans,
static int iwl_dbg_tlv_config_set(struct iwl_trans *trans,
				  const struct iwl_ucode_tlv *tlv)
{
	struct iwl_fw_ini_conf_set_tlv *conf_set = (void *)tlv->data;
	const struct iwl_fw_ini_conf_set_tlv *conf_set = (const void *)tlv->data;
	u32 tp = le32_to_cpu(conf_set->time_point);
	u32 type = le32_to_cpu(conf_set->set_type);

+2 −2
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ static void iwl_parse_dbg_tlv_assert_tables(struct iwl_drv *drv,
		     sizeof(region->special_mem))
		return;

	region = (void *)tlv->data;
	region = (const void *)tlv->data;
	addr = le32_to_cpu(region->special_mem.base_addr);
	addr += le32_to_cpu(region->special_mem.offset);
	addr &= ~FW_ADDR_CACHE_CONTROL;
@@ -1279,7 +1279,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,

	if (len) {
		IWL_ERR(drv, "invalid TLV after parsing: %zd\n", len);
		iwl_print_hex_dump(drv, IWL_DL_FW, (u8 *)data, len);
		iwl_print_hex_dump(drv, IWL_DL_FW, data, len);
		return -EINVAL;
	}

+1 −1
Original line number Diff line number Diff line
@@ -732,7 +732,7 @@ static void iwl_init_he_6ghz_capa(struct iwl_trans *trans,
	IWL_DEBUG_EEPROM(trans->dev, "he_6ghz_capa=0x%x\n", he_6ghz_capa);

	/* we know it's writable - we set it before ourselves */
	iftype_data = (void *)sband->iftype_data;
	iftype_data = (void *)(uintptr_t)sband->iftype_data;
	for (i = 0; i < sband->n_iftype_data; i++)
		iftype_data[i].he_6ghz_capa.capa = cpu_to_le16(he_6ghz_capa);
}
Loading