Skip to content

Commit 40d50cf

Browse files
Roman Fietzeozbenh
authored andcommitted
powerpc: Make "intspec" pointers in irq_host->xlate() const
Writing a driver using SCLPC on the MPC5200B I detected, that the intspec arrays to map irqs to Linux virq cannot be const, because the mapping and xlate functions only take non const pointers. All those functions do not modify the intspec, so a const pointer could be used. Signed-off-by: Roman Fietze <roman.fietze@telemotive.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
1 parent 990d89c commit 40d50cf

21 files changed

Lines changed: 23 additions & 23 deletions

File tree

‎arch/powerpc/include/asm/irq.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ struct irq_host_ops {
100100
* interrupt controller has for that line)
101101
*/
102102
int (*xlate)(struct irq_host *h, struct device_node *ctrler,
103-
u32 *intspec, unsigned int intsize,
103+
const u32 *intspec, unsigned int intsize,
104104
irq_hw_number_t *out_hwirq, unsigned int *out_type);
105105
};
106106

@@ -314,7 +314,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
314314
* of the of_irq_map_*() functions.
315315
*/
316316
extern unsigned int irq_create_of_mapping(struct device_node *controller,
317-
u32 *intspec, unsigned int intsize);
317+
const u32 *intspec, unsigned int intsize);
318318

319319
/**
320320
* irq_of_parse_and_map - Parse and Map an interrupt into linux virq space

‎arch/powerpc/kernel/irq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ unsigned int irq_create_mapping(struct irq_host *host,
725725
EXPORT_SYMBOL_GPL(irq_create_mapping);
726726

727727
unsigned int irq_create_of_mapping(struct device_node *controller,
728-
u32 *intspec, unsigned int intsize)
728+
const u32 *intspec, unsigned int intsize)
729729
{
730730
struct irq_host *host;
731731
irq_hw_number_t hwirq;

‎arch/powerpc/platforms/52xx/media5200.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static int media5200_irq_map(struct irq_host *h, unsigned int virq,
127127
}
128128

129129
static int media5200_irq_xlate(struct irq_host *h, struct device_node *ct,
130-
u32 *intspec, unsigned int intsize,
130+
const u32 *intspec, unsigned int intsize,
131131
irq_hw_number_t *out_hwirq,
132132
unsigned int *out_flags)
133133
{

‎arch/powerpc/platforms/52xx/mpc52xx_gpt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static int mpc52xx_gpt_irq_map(struct irq_host *h, unsigned int virq,
214214
}
215215

216216
static int mpc52xx_gpt_irq_xlate(struct irq_host *h, struct device_node *ct,
217-
u32 *intspec, unsigned int intsize,
217+
const u32 *intspec, unsigned int intsize,
218218
irq_hw_number_t *out_hwirq,
219219
unsigned int *out_flags)
220220
{

‎arch/powerpc/platforms/52xx/mpc52xx_pic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static int mpc52xx_is_extirq(int l1, int l2)
355355
* mpc52xx_irqhost_xlate - translate virq# from device tree interrupts property
356356
*/
357357
static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
358-
u32 *intspec, unsigned int intsize,
358+
const u32 *intspec, unsigned int intsize,
359359
irq_hw_number_t *out_hwirq,
360360
unsigned int *out_flags)
361361
{

‎arch/powerpc/platforms/85xx/socrates_fpga_pic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ static int socrates_fpga_pic_host_map(struct irq_host *h, unsigned int virq,
253253
}
254254

255255
static int socrates_fpga_pic_host_xlate(struct irq_host *h,
256-
struct device_node *ct, u32 *intspec, unsigned int intsize,
256+
struct device_node *ct, const u32 *intspec, unsigned int intsize,
257257
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
258258
{
259259
struct socrates_fpga_irq_info *fpga_irq = &fpga_irqs[intspec[0]];

‎arch/powerpc/platforms/86xx/gef_pic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static int gef_pic_host_map(struct irq_host *h, unsigned int virq,
170170
}
171171

172172
static int gef_pic_host_xlate(struct irq_host *h, struct device_node *ct,
173-
u32 *intspec, unsigned int intsize,
173+
const u32 *intspec, unsigned int intsize,
174174
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
175175
{
176176

‎arch/powerpc/platforms/cell/beat_interrupt.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ static void beatic_pic_host_remap(struct irq_host *h, unsigned int virq,
166166
* Note: We have only 1 entry to translate.
167167
*/
168168
static int beatic_pic_host_xlate(struct irq_host *h, struct device_node *ct,
169-
u32 *intspec, unsigned int intsize,
169+
const u32 *intspec, unsigned int intsize,
170170
irq_hw_number_t *out_hwirq,
171171
unsigned int *out_flags)
172172
{
173-
u64 *intspec2 = (u64 *)intspec;
173+
const u64 *intspec2 = (const u64 *)intspec;
174174

175175
*out_hwirq = *intspec2;
176176
*out_flags |= IRQ_TYPE_LEVEL_LOW;

‎arch/powerpc/platforms/cell/interrupt.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static int iic_host_map(struct irq_host *h, unsigned int virq,
297297
}
298298

299299
static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
300-
u32 *intspec, unsigned int intsize,
300+
const u32 *intspec, unsigned int intsize,
301301
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
302302

303303
{

‎arch/powerpc/platforms/cell/spider-pic.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static int spider_host_map(struct irq_host *h, unsigned int virq,
187187
}
188188

189189
static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
190-
u32 *intspec, unsigned int intsize,
190+
const u32 *intspec, unsigned int intsize,
191191
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
192192

193193
{

0 commit comments

Comments
 (0)