aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intr_remapping.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:49:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:06 -0400
commita06148c36d3163aee4d5d2cad4e87032d74eaa6d (patch)
treebfdbccdb2d06c66511f5b1fd6cf524a501e31ff9 /drivers/pci/intr_remapping.c
parent60e4ad7a72fd7ce562cdf8dd850289e1e76bc1b1 (diff)
drivers/pci/ intr remapping: use nr_irqs
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/intr_remapping.c')
-rw-r--r--drivers/pci/intr_remapping.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index bb642cc5e18c..980566e3352b 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -22,7 +22,7 @@ static DEFINE_SPINLOCK(irq_2_ir_lock);
22 22
23int irq_remapped(int irq) 23int irq_remapped(int irq)
24{ 24{
25 if (irq > NR_IRQS) 25 if (irq > nr_irqs)
26 return 0; 26 return 0;
27 27
28 if (!irq_2_iommu[irq].iommu) 28 if (!irq_2_iommu[irq].iommu)
@@ -35,7 +35,7 @@ int get_irte(int irq, struct irte *entry)
35{ 35{
36 int index; 36 int index;
37 37
38 if (!entry || irq > NR_IRQS) 38 if (!entry || irq > nr_irqs)
39 return -1; 39 return -1;
40 40
41 spin_lock(&irq_2_ir_lock); 41 spin_lock(&irq_2_ir_lock);
@@ -126,7 +126,7 @@ int map_irq_to_irte_handle(int irq, u16 *sub_handle)
126 int index; 126 int index;
127 127
128 spin_lock(&irq_2_ir_lock); 128 spin_lock(&irq_2_ir_lock);
129 if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { 129 if (irq >= nr_irqs || !irq_2_iommu[irq].iommu) {
130 spin_unlock(&irq_2_ir_lock); 130 spin_unlock(&irq_2_ir_lock);
131 return -1; 131 return -1;
132 } 132 }
@@ -140,7 +140,7 @@ int map_irq_to_irte_handle(int irq, u16 *sub_handle)
140int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) 140int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
141{ 141{
142 spin_lock(&irq_2_ir_lock); 142 spin_lock(&irq_2_ir_lock);
143 if (irq >= NR_IRQS || irq_2_iommu[irq].iommu) { 143 if (irq >= nr_irqs || irq_2_iommu[irq].iommu) {
144 spin_unlock(&irq_2_ir_lock); 144 spin_unlock(&irq_2_ir_lock);
145 return -1; 145 return -1;
146 } 146 }
@@ -158,7 +158,7 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
158int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index) 158int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index)
159{ 159{
160 spin_lock(&irq_2_ir_lock); 160 spin_lock(&irq_2_ir_lock);
161 if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { 161 if (irq >= nr_irqs || !irq_2_iommu[irq].iommu) {
162 spin_unlock(&irq_2_ir_lock); 162 spin_unlock(&irq_2_ir_lock);
163 return -1; 163 return -1;
164 } 164 }
@@ -180,7 +180,7 @@ int modify_irte(int irq, struct irte *irte_modified)
180 struct intel_iommu *iommu; 180 struct intel_iommu *iommu;
181 181
182 spin_lock(&irq_2_ir_lock); 182 spin_lock(&irq_2_ir_lock);
183 if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { 183 if (irq >= nr_irqs || !irq_2_iommu[irq].iommu) {
184 spin_unlock(&irq_2_ir_lock); 184 spin_unlock(&irq_2_ir_lock);
185 return -1; 185 return -1;
186 } 186 }
@@ -205,7 +205,7 @@ int flush_irte(int irq)
205 struct intel_iommu *iommu; 205 struct intel_iommu *iommu;
206 206
207 spin_lock(&irq_2_ir_lock); 207 spin_lock(&irq_2_ir_lock);
208 if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { 208 if (irq >= nr_irqs || !irq_2_iommu[irq].iommu) {
209 spin_unlock(&irq_2_ir_lock); 209 spin_unlock(&irq_2_ir_lock);
210 return -1; 210 return -1;
211 } 211 }
@@ -248,7 +248,7 @@ int free_irte(int irq)
248 struct intel_iommu *iommu; 248 struct intel_iommu *iommu;
249 249
250 spin_lock(&irq_2_ir_lock); 250 spin_lock(&irq_2_ir_lock);
251 if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { 251 if (irq >= nr_irqs || !irq_2_iommu[irq].iommu) {
252 spin_unlock(&irq_2_ir_lock); 252 spin_unlock(&irq_2_ir_lock);
253 return -1; 253 return -1;
254 } 254 }