@@ -162,11 +162,6 @@ static inline void __iomem *gic_cpu_base(struct irq_data *d)
162
162
return gic_data_cpu_base (gic_data );
163
163
}
164
164
165
- static inline unsigned int gic_irq (struct irq_data * d )
166
- {
167
- return d -> hwirq ;
168
- }
169
-
170
165
static inline bool cascading_gic_irq (struct irq_data * d )
171
166
{
172
167
void * data = irq_data_get_irq_handler_data (d );
@@ -183,14 +178,16 @@ static inline bool cascading_gic_irq(struct irq_data *d)
183
178
*/
184
179
static void gic_poke_irq (struct irq_data * d , u32 offset )
185
180
{
186
- u32 mask = 1 << (gic_irq (d ) % 32 );
187
- writel_relaxed (mask , gic_dist_base (d ) + offset + (gic_irq (d ) / 32 ) * 4 );
181
+ u32 mask = 1 << (irqd_to_hwirq (d ) % 32 );
182
+
183
+ writel_relaxed (mask , gic_dist_base (d ) + offset + (irqd_to_hwirq (d ) / 32 ) * 4 );
188
184
}
189
185
190
186
static int gic_peek_irq (struct irq_data * d , u32 offset )
191
187
{
192
- u32 mask = 1 << (gic_irq (d ) % 32 );
193
- return !!(readl_relaxed (gic_dist_base (d ) + offset + (gic_irq (d ) / 32 ) * 4 ) & mask );
188
+ u32 mask = 1 << (irqd_to_hwirq (d ) % 32 );
189
+
190
+ return !!(readl_relaxed (gic_dist_base (d ) + offset + (irqd_to_hwirq (d ) / 32 ) * 4 ) & mask );
194
191
}
195
192
196
193
static void gic_mask_irq (struct irq_data * d )
@@ -220,7 +217,7 @@ static void gic_unmask_irq(struct irq_data *d)
220
217
221
218
static void gic_eoi_irq (struct irq_data * d )
222
219
{
223
- u32 hwirq = gic_irq (d );
220
+ irq_hw_number_t hwirq = irqd_to_hwirq (d );
224
221
225
222
if (hwirq < 16 )
226
223
hwirq = this_cpu_read (sgi_intid );
@@ -230,7 +227,7 @@ static void gic_eoi_irq(struct irq_data *d)
230
227
231
228
static void gic_eoimode1_eoi_irq (struct irq_data * d )
232
229
{
233
- u32 hwirq = gic_irq (d );
230
+ irq_hw_number_t hwirq = irqd_to_hwirq (d );
234
231
235
232
/* Do not deactivate an IRQ forwarded to a vcpu. */
236
233
if (irqd_is_forwarded_to_vcpu (d ))
@@ -293,8 +290,8 @@ static int gic_irq_get_irqchip_state(struct irq_data *d,
293
290
294
291
static int gic_set_type (struct irq_data * d , unsigned int type )
295
292
{
293
+ irq_hw_number_t gicirq = irqd_to_hwirq (d );
296
294
void __iomem * base = gic_dist_base (d );
297
- unsigned int gicirq = gic_irq (d );
298
295
int ret ;
299
296
300
297
/* Interrupt configuration for SGIs can't be changed */
@@ -309,7 +306,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
309
306
ret = gic_configure_irq (gicirq , type , base + GIC_DIST_CONFIG , NULL );
310
307
if (ret && gicirq < 32 ) {
311
308
/* Misconfigured PPIs are usually not fatal */
312
- pr_warn ("GIC: PPI%d is secure or misconfigured\n" , gicirq - 16 );
309
+ pr_warn ("GIC: PPI%ld is secure or misconfigured\n" , gicirq - 16 );
313
310
ret = 0 ;
314
311
}
315
312
@@ -319,7 +316,7 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
319
316
static int gic_irq_set_vcpu_affinity (struct irq_data * d , void * vcpu )
320
317
{
321
318
/* Only interrupts on the primary GIC can be forwarded to a vcpu. */
322
- if (cascading_gic_irq (d ) || gic_irq (d ) < 16 )
319
+ if (cascading_gic_irq (d ) || irqd_to_hwirq (d ) < 16 )
323
320
return - EINVAL ;
324
321
325
322
if (vcpu )
@@ -796,7 +793,7 @@ static void rmw_writeb(u8 bval, void __iomem *addr)
796
793
static int gic_set_affinity (struct irq_data * d , const struct cpumask * mask_val ,
797
794
bool force )
798
795
{
799
- void __iomem * reg = gic_dist_base (d ) + GIC_DIST_TARGET + gic_irq (d );
796
+ void __iomem * reg = gic_dist_base (d ) + GIC_DIST_TARGET + irqd_to_hwirq (d );
800
797
struct gic_chip_data * gic = irq_data_get_irq_chip_data (d );
801
798
unsigned int cpu ;
802
799
0 commit comments