Skip to content

Commit

Permalink
powerpc: Make "intspec" pointers in irq_host->xlate() const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roman Fietze authored and Benjamin Herrenschmidt committed Dec 9, 2009
1 parent 990d89c commit 40d50cf
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct irq_host_ops {
* interrupt controller has for that line)
*/
int (*xlate)(struct irq_host *h, struct device_node *ctrler,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_type);
};

Expand Down Expand Up @@ -314,7 +314,7 @@ extern void irq_free_virt(unsigned int virq, unsigned int count);
* of the of_irq_map_*() functions.
*/
extern unsigned int irq_create_of_mapping(struct device_node *controller,
u32 *intspec, unsigned int intsize);
const u32 *intspec, unsigned int intsize);

/**
* irq_of_parse_and_map - Parse and Map an interrupt into linux virq space
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ unsigned int irq_create_mapping(struct irq_host *host,
EXPORT_SYMBOL_GPL(irq_create_mapping);

unsigned int irq_create_of_mapping(struct device_node *controller,
u32 *intspec, unsigned int intsize)
const u32 *intspec, unsigned int intsize)
{
struct irq_host *host;
irq_hw_number_t hwirq;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/52xx/media5200.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int media5200_irq_map(struct irq_host *h, unsigned int virq,
}

static int media5200_irq_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/52xx/mpc52xx_gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static int mpc52xx_gpt_irq_map(struct irq_host *h, unsigned int virq,
}

static int mpc52xx_gpt_irq_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/52xx/mpc52xx_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static int mpc52xx_is_extirq(int l1, int l2)
* mpc52xx_irqhost_xlate - translate virq# from device tree interrupts property
*/
static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/85xx/socrates_fpga_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int socrates_fpga_pic_host_map(struct irq_host *h, unsigned int virq,
}

static int socrates_fpga_pic_host_xlate(struct irq_host *h,
struct device_node *ct, u32 *intspec, unsigned int intsize,
struct device_node *ct, const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
struct socrates_fpga_irq_info *fpga_irq = &fpga_irqs[intspec[0]];
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/86xx/gef_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static int gef_pic_host_map(struct irq_host *h, unsigned int virq,
}

static int gef_pic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{

Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/platforms/cell/beat_interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ static void beatic_pic_host_remap(struct irq_host *h, unsigned int virq,
* Note: We have only 1 entry to translate.
*/
static int beatic_pic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)
{
u64 *intspec2 = (u64 *)intspec;
const u64 *intspec2 = (const u64 *)intspec;

*out_hwirq = *intspec2;
*out_flags |= IRQ_TYPE_LEVEL_LOW;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static int iic_host_map(struct irq_host *h, unsigned int virq,
}

static int iic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spider-pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int spider_host_map(struct irq_host *h, unsigned int virq,
}

static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/powermac/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
}

static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ static int xics_host_map(struct irq_host *h, unsigned int virq,
}

static int xics_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/cpm2_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
}

static int cpm2_pic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
*out_hwirq = intspec[0];
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/i8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static void i8259_host_unmap(struct irq_host *h, unsigned int virq)
}

static int i8259_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
static unsigned char map_isa_senses[4] = {
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/ipic.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ static int ipic_host_map(struct irq_host *h, unsigned int virq,
}

static int ipic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/mpc8xx_pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq,


static int mpc8xx_pic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
static unsigned char map_pic_senses[4] = {
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ static int mpic_host_map(struct irq_host *h, unsigned int virq,
}

static int mpic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/qe_lib/qe_ic.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
}

static int qe_ic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 * intspec, unsigned int intsize,
const u32 * intspec, unsigned int intsize,
irq_hw_number_t * out_hwirq,
unsigned int *out_flags)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/tsi108_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static struct irq_chip tsi108_pci_irq = {
};

static int pci_irq_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_flags)
{
*out_hwirq = intspec[0];
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/uic.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ static int uic_host_map(struct irq_host *h, unsigned int virq,
}

static int uic_host_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq, unsigned int *out_type)

{
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/sysdev/xilinx_intc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static struct irq_chip xilinx_intc_edge_irqchip = {
* xilinx_intc_xlate - translate virq# from device tree interrupts property
*/
static int xilinx_intc_xlate(struct irq_host *h, struct device_node *ct,
u32 *intspec, unsigned int intsize,
const u32 *intspec, unsigned int intsize,
irq_hw_number_t *out_hwirq,
unsigned int *out_flags)
{
Expand Down

0 comments on commit 40d50cf

Please sign in to comment.