Commit 33a40386 authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Luca Coelho

iwlwifi: dbg_ini: remove redundant type argument from iwl_dump_ini_mem

Since iwl_dump_ini_mem receive struct iwl_fw_ini_region_cfg which holds
the region type, there is no point to pass the type separately.
Signed-off-by: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 84294b5b
...@@ -1664,17 +1664,17 @@ struct iwl_dump_ini_mem_ops { ...@@ -1664,17 +1664,17 @@ struct iwl_dump_ini_mem_ops {
* @fwrt: fw runtime struct. * @fwrt: fw runtime struct.
* @data: dump memory data. * @data: dump memory data.
* @reg: region to copy to the dump. * @reg: region to copy to the dump.
* @ops: memory dump operations.
*/ */
static void static void
iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt, iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt,
enum iwl_fw_ini_region_type type,
struct iwl_fw_error_dump_data **data, struct iwl_fw_error_dump_data **data,
struct iwl_fw_ini_region_cfg *reg, struct iwl_fw_ini_region_cfg *reg,
struct iwl_dump_ini_mem_ops *ops) struct iwl_dump_ini_mem_ops *ops)
{ {
struct iwl_fw_ini_error_dump_header *header = (void *)(*data)->data; struct iwl_fw_ini_error_dump_header *header = (void *)(*data)->data;
u32 num_of_ranges, i, type = le32_to_cpu(reg->region_type);
void *range; void *range;
u32 num_of_ranges, i;
if (WARN_ON(!ops || !ops->get_num_of_ranges || !ops->get_size || if (WARN_ON(!ops || !ops->get_num_of_ranges || !ops->get_size ||
!ops->fill_mem_hdr || !ops->fill_range)) !ops->fill_mem_hdr || !ops->fill_range))
...@@ -1722,7 +1722,6 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt, ...@@ -1722,7 +1722,6 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,
for (i = 0; i < le32_to_cpu(trigger->num_regions); i++) { for (i = 0; i < le32_to_cpu(trigger->num_regions); i++) {
u32 reg_id = le32_to_cpu(trigger->data[i]); u32 reg_id = le32_to_cpu(trigger->data[i]);
struct iwl_fw_ini_region_cfg *reg; struct iwl_fw_ini_region_cfg *reg;
enum iwl_fw_ini_region_type type;
if (WARN_ON(reg_id >= ARRAY_SIZE(fwrt->dump.active_regs))) if (WARN_ON(reg_id >= ARRAY_SIZE(fwrt->dump.active_regs)))
continue; continue;
...@@ -1731,8 +1730,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt, ...@@ -1731,8 +1730,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,
if (WARN(!reg, "Unassigned region %d\n", reg_id)) if (WARN(!reg, "Unassigned region %d\n", reg_id))
continue; continue;
type = le32_to_cpu(reg->region_type); switch (le32_to_cpu(reg->region_type)) {
switch (type) {
case IWL_FW_INI_REGION_DEVICE_MEMORY: case IWL_FW_INI_REGION_DEVICE_MEMORY:
case IWL_FW_INI_REGION_PERIPHERY_MAC: case IWL_FW_INI_REGION_PERIPHERY_MAC:
case IWL_FW_INI_REGION_PERIPHERY_PHY: case IWL_FW_INI_REGION_PERIPHERY_PHY:
...@@ -1782,7 +1780,6 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1782,7 +1780,6 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
u32 reg_id = le32_to_cpu(trigger->data[i]); u32 reg_id = le32_to_cpu(trigger->data[i]);
enum iwl_fw_ini_region_type type;
struct iwl_fw_ini_region_cfg *reg; struct iwl_fw_ini_region_cfg *reg;
struct iwl_dump_ini_mem_ops ops; struct iwl_dump_ini_mem_ops ops;
...@@ -1798,14 +1795,13 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1798,14 +1795,13 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
if (le32_to_cpu(reg->domain) != IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON) if (le32_to_cpu(reg->domain) != IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON)
continue; continue;
type = le32_to_cpu(reg->region_type); switch (le32_to_cpu(reg->region_type)) {
switch (type) {
case IWL_FW_INI_REGION_DEVICE_MEMORY: case IWL_FW_INI_REGION_DEVICE_MEMORY:
ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; ops.get_num_of_ranges = iwl_dump_ini_mem_ranges;
ops.get_size = iwl_dump_ini_mem_get_size; ops.get_size = iwl_dump_ini_mem_get_size;
ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
ops.fill_range = iwl_dump_ini_dev_mem_iter; ops.fill_range = iwl_dump_ini_dev_mem_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_PERIPHERY_MAC: case IWL_FW_INI_REGION_PERIPHERY_MAC:
case IWL_FW_INI_REGION_PERIPHERY_PHY: case IWL_FW_INI_REGION_PERIPHERY_PHY:
...@@ -1814,21 +1810,21 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1814,21 +1810,21 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
ops.get_size = iwl_dump_ini_mem_get_size; ops.get_size = iwl_dump_ini_mem_get_size;
ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
ops.fill_range = iwl_dump_ini_prph_iter; ops.fill_range = iwl_dump_ini_prph_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_DRAM_BUFFER: case IWL_FW_INI_REGION_DRAM_BUFFER:
ops.get_num_of_ranges = iwl_dump_ini_mon_dram_ranges; ops.get_num_of_ranges = iwl_dump_ini_mon_dram_ranges;
ops.get_size = iwl_dump_ini_mon_dram_get_size; ops.get_size = iwl_dump_ini_mon_dram_get_size;
ops.fill_mem_hdr = iwl_dump_ini_mon_dram_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mon_dram_fill_header;
ops.fill_range = iwl_dump_ini_mon_dram_iter; ops.fill_range = iwl_dump_ini_mon_dram_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_INTERNAL_BUFFER: case IWL_FW_INI_REGION_INTERNAL_BUFFER:
ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; ops.get_num_of_ranges = iwl_dump_ini_mem_ranges;
ops.get_size = iwl_dump_ini_mon_smem_get_size; ops.get_size = iwl_dump_ini_mon_smem_get_size;
ops.fill_mem_hdr = iwl_dump_ini_mon_smem_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mon_smem_fill_header;
ops.fill_range = iwl_dump_ini_dev_mem_iter; ops.fill_range = iwl_dump_ini_dev_mem_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_PAGING: case IWL_FW_INI_REGION_PAGING:
ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
...@@ -1845,7 +1841,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1845,7 +1841,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
ops.fill_range = iwl_dump_ini_paging_gen2_iter; ops.fill_range = iwl_dump_ini_paging_gen2_iter;
} }
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_TXF: { case IWL_FW_INI_REGION_TXF: {
struct iwl_ini_txf_iter_data iter = { .init = true }; struct iwl_ini_txf_iter_data iter = { .init = true };
...@@ -1856,7 +1852,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1856,7 +1852,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
ops.get_size = iwl_dump_ini_txf_get_size; ops.get_size = iwl_dump_ini_txf_get_size;
ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header; ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header;
ops.fill_range = iwl_dump_ini_txf_iter; ops.fill_range = iwl_dump_ini_txf_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
fwrt->dump.fifo_iter = fifo_iter; fwrt->dump.fifo_iter = fifo_iter;
break; break;
} }
...@@ -1865,14 +1861,14 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, ...@@ -1865,14 +1861,14 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,
ops.get_size = iwl_dump_ini_rxf_get_size; ops.get_size = iwl_dump_ini_rxf_get_size;
ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header; ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header;
ops.fill_range = iwl_dump_ini_rxf_iter; ops.fill_range = iwl_dump_ini_rxf_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_CSR: case IWL_FW_INI_REGION_CSR:
ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; ops.get_num_of_ranges = iwl_dump_ini_mem_ranges;
ops.get_size = iwl_dump_ini_mem_get_size; ops.get_size = iwl_dump_ini_mem_get_size;
ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
ops.fill_range = iwl_dump_ini_csr_iter; ops.fill_range = iwl_dump_ini_csr_iter;
iwl_dump_ini_mem(fwrt, type, data, reg, &ops); iwl_dump_ini_mem(fwrt, data, reg, &ops);
break; break;
case IWL_FW_INI_REGION_DRAM_IMR: case IWL_FW_INI_REGION_DRAM_IMR:
/* This is undefined yet */ /* This is undefined yet */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment