Commit 3827cb59 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho
Browse files

iwlwifi: avoid void pointer arithmetic



Avoid void pointer arithmetic since it's technically
undefined and causes warnings in some places that use
our code.

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.e349104ecd94.Iadc937f475158b9437becdfefb361a97e7eaa934@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 86e8e657
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1992,7 +1992,7 @@ static u32 iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt, struct list_head *list,
	u32 type = reg->type;
	u32 id = le32_to_cpu(reg->id);
	u32 num_of_ranges, i, size;
	void *range;
	u8 *range;

	/*
	 * The higher part of the ID from 2 is irrelevant for
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ static int iwl_fill_paging_mem(struct iwl_fw_runtime *fwrt,
		}

		memcpy(page_address(block->fw_paging_block),
		       image->sec[sec_idx].data + offset, len);
		       (const u8 *)image->sec[sec_idx].data + offset, len);
		block->fw_offs = image->sec[sec_idx].offset + offset;
		dma_sync_single_for_device(fwrt->trans->dev,
					   block->fw_paging_phys,
+1 −1
Original line number Diff line number Diff line
@@ -1084,7 +1084,7 @@ static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
					sizeof(struct iwl_wowlan_kek_kck_material_cmd_v2);
			/* skip the sta_id at the beginning */
			_kek_kck_cmd = (void *)
				((u8 *)_kek_kck_cmd) + sizeof(kek_kck_cmd.sta_id);
				((u8 *)_kek_kck_cmd + sizeof(kek_kck_cmd.sta_id));
		}

		IWL_DEBUG_WOWLAN(mvm, "setting akm %d\n",
+1 −1
Original line number Diff line number Diff line
@@ -1945,7 +1945,7 @@ static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
		goto out;
	}

	ret = len - copy_to_user(user_buf, (void *)rsp->data + delta, len);
	ret = len - copy_to_user(user_buf, (u8 *)rsp->data + delta, len);
	*ppos += ret;

out:
+1 −1
Original line number Diff line number Diff line
@@ -735,7 +735,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm)
		mvm->nvm_data->bands[0].n_channels = 1;
		mvm->nvm_data->bands[0].n_bitrates = 1;
		mvm->nvm_data->bands[0].bitrates =
			(void *)mvm->nvm_data->channels + 1;
			(void *)((u8 *)mvm->nvm_data->channels + 1);
		mvm->nvm_data->bands[0].bitrates->hw_value = 10;
	}

Loading