Skip to content

Commit 74a3781

Browse files
ssuthiku-amdjoergroedel
authored andcommitted
iommu/amd: Remove the unused struct amd_ir_data.ref
Since the amd_iommu_update_ga() has been switched to use the modify_irte_ga() helper function to update the IRTE, the parameter is no longer needed. Reviewed-by: Jerry Snitselaar <[email protected]> Suggested-by: Vasant Hegde <[email protected]> Signed-off-by: Suravee Suthikulpanit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent a42f0c7 commit 74a3781

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,6 @@ struct amd_ir_data {
10011001
struct irq_2_irte irq_2_irte;
10021002
struct msi_msg msi_entry;
10031003
void *entry; /* Pointer to union irte or struct irte_ga */
1004-
void *ref; /* Pointer to the actual irte */
10051004

10061005
/**
10071006
* Store information for activate/de-activate

drivers/iommu/amd/iommu.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ static int alloc_irq_index(struct amd_iommu *iommu, u16 devid, int count,
30013001
}
30023002

30033003
static int modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
3004-
struct irte_ga *irte, struct amd_ir_data *data)
3004+
struct irte_ga *irte)
30053005
{
30063006
bool ret;
30073007
struct irq_remap_table *table;
@@ -3028,9 +3028,6 @@ static int modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,
30283028
*/
30293029
WARN_ON(!ret);
30303030

3031-
if (data)
3032-
data->ref = entry;
3033-
30343031
raw_spin_unlock_irqrestore(&table->lock, flags);
30353032

30363033
iommu_flush_irt(iommu, devid);
@@ -3119,7 +3116,7 @@ static void irte_ga_activate(struct amd_iommu *iommu, void *entry, u16 devid, u1
31193116
struct irte_ga *irte = (struct irte_ga *) entry;
31203117

31213118
irte->lo.fields_remap.valid = 1;
3122-
modify_irte_ga(iommu, devid, index, irte, NULL);
3119+
modify_irte_ga(iommu, devid, index, irte);
31233120
}
31243121

31253122
static void irte_deactivate(struct amd_iommu *iommu, void *entry, u16 devid, u16 index)
@@ -3135,7 +3132,7 @@ static void irte_ga_deactivate(struct amd_iommu *iommu, void *entry, u16 devid,
31353132
struct irte_ga *irte = (struct irte_ga *) entry;
31363133

31373134
irte->lo.fields_remap.valid = 0;
3138-
modify_irte_ga(iommu, devid, index, irte, NULL);
3135+
modify_irte_ga(iommu, devid, index, irte);
31393136
}
31403137

31413138
static void irte_set_affinity(struct amd_iommu *iommu, void *entry, u16 devid, u16 index,
@@ -3159,7 +3156,7 @@ static void irte_ga_set_affinity(struct amd_iommu *iommu, void *entry, u16 devid
31593156
APICID_TO_IRTE_DEST_LO(dest_apicid);
31603157
irte->hi.fields.destination =
31613158
APICID_TO_IRTE_DEST_HI(dest_apicid);
3162-
modify_irte_ga(iommu, devid, index, irte, NULL);
3159+
modify_irte_ga(iommu, devid, index, irte);
31633160
}
31643161
}
31653162

@@ -3510,7 +3507,7 @@ int amd_iommu_activate_guest_mode(void *data)
35103507
entry->lo.fields_vapic.ga_tag = ir_data->ga_tag;
35113508

35123509
return modify_irte_ga(ir_data->iommu, ir_data->irq_2_irte.devid,
3513-
ir_data->irq_2_irte.index, entry, ir_data);
3510+
ir_data->irq_2_irte.index, entry);
35143511
}
35153512
EXPORT_SYMBOL(amd_iommu_activate_guest_mode);
35163513

@@ -3540,7 +3537,7 @@ int amd_iommu_deactivate_guest_mode(void *data)
35403537
APICID_TO_IRTE_DEST_HI(cfg->dest_apicid);
35413538

35423539
return modify_irte_ga(ir_data->iommu, ir_data->irq_2_irte.devid,
3543-
ir_data->irq_2_irte.index, entry, ir_data);
3540+
ir_data->irq_2_irte.index, entry);
35443541
}
35453542
EXPORT_SYMBOL(amd_iommu_deactivate_guest_mode);
35463543

@@ -3721,7 +3718,7 @@ int amd_iommu_update_ga(int cpu, bool is_run, void *data)
37213718
entry->lo.fields_vapic.is_run = is_run;
37223719

37233720
return modify_irte_ga(ir_data->iommu, ir_data->irq_2_irte.devid,
3724-
ir_data->irq_2_irte.index, entry, ir_data);
3721+
ir_data->irq_2_irte.index, entry);
37253722
}
37263723
EXPORT_SYMBOL(amd_iommu_update_ga);
37273724
#endif

0 commit comments

Comments
 (0)