powerpc: Make "intspec" pointers in irq_host->xlate() const
authorRoman Fietze <roman.fietze@telemotive.de>
Tue, 8 Dec 2009 02:39:50 +0000 (02:39 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 9 Dec 2009 06:10:37 +0000 (17:10 +1100)
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>
21 files changed:
arch/powerpc/include/asm/irq.h
arch/powerpc/kernel/irq.c
arch/powerpc/platforms/52xx/media5200.c
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/52xx/mpc52xx_pic.c
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
arch/powerpc/platforms/86xx/gef_pic.c
arch/powerpc/platforms/cell/beat_interrupt.c
arch/powerpc/platforms/cell/interrupt.c
arch/powerpc/platforms/cell/spider-pic.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/pseries/xics.c
arch/powerpc/sysdev/cpm2_pic.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/ipic.c
arch/powerpc/sysdev/mpc8xx_pic.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/qe_lib/qe_ic.c
arch/powerpc/sysdev/tsi108_pci.c
arch/powerpc/sysdev/uic.c
arch/powerpc/sysdev/xilinx_intc.c

index c85a32f1a17fc0d88f092c469a6557d8e49f147f..e054baef184599f2c13703ed688afb1d8fe0d3f6 100644 (file)
@@ -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);
 };
 
@@ -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
index a31176ace02b008e6d5456789a794c46f822b057..042a5300970196426d2669c1b1a3a2d0931956c4 100644 (file)
@@ -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;
index 85001a4cbdffeef14aa8151ad1cb4c8cfe374b8c..cc0c854291d7397837f371d94a2922e7a7464c66 100644 (file)
@@ -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)
 {
index 17ecdf4c87ae2354c490c8a070c8a223b227bcda..6f8ebe1085b3c40701647ee8ba8e0da5a4a4b247 100644 (file)
@@ -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)
 {
index a3122d163b6ab48b4f4465c5d7ac239afc69932a..4bf4bf7b063ecabdc0c3d15fc11fbd21ca3aacc4 100644 (file)
@@ -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)
 {
index 37a2e5f60af9ef115b47016e649e305a5b728f5d..e5da5f62b24af4ef2a71b67455ce179f3a879896 100644 (file)
@@ -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]];
index e1d5d36995dfb508b97251b4266576a7be728d1b..0110a8736d331976757de19ada74a1dd895cead2 100644 (file)
@@ -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)
 {
 
index c3479a47d45abadc8d8e0534516edf322498a3d5..36052a9ebcda68e7fb4f5380309f684d1f9df47f 100644 (file)
@@ -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;
index 3b67afba3f9b7c73ec2c259abbd2d3d1374bba21..f9dbf76a763f74fea41d2af522a23123f6880250 100644 (file)
@@ -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)
 
 {
index 167dedaada768dff0038f55624ee429695b24fba..01244f254a115ee32ff3019222b61abdc470a987 100644 (file)
@@ -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)
 
 {
index 99d0b313e9a5ccb9df7488cb7b29e24164f6e977..09e827296276e24d3fa32ea728adcb040f95a8c1 100644 (file)
@@ -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)
 
index 6592becd44100cdfbd7520281ecfe86ab74fb4cc..690f87584f6b5efaee04ff7321fcb72cd97a1e95 100644 (file)
@@ -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)
 
 {
index 059ea4e5e25f080d4d1a6df0a93c55a6734aa143..971483f0dfacd9f104246045a9300b80014ebe98 100644 (file)
@@ -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];
index ba8f1f70899282ec5b5ec8632b0da43ca7f58918..0a55db8a5a2912ae1f7a55b87d4a0fe05aa8d045 100644 (file)
@@ -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] = {
index c89d78075ba0cbd7746e6645bf6066040340d7f2..28cdddd2f89e6265aca60a1ec8f41ba68b66caa9 100644 (file)
@@ -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)
 
 {
index db0a712f607545cdcf2d45ec171904bdf3ca89a2..69bd6f4dff83a3f67ee1a8e3d1c958cd293d48a2 100644 (file)
@@ -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] = {
index 7a64bc5808dae8904cb0df353815eb0da652515d..aa9d06e5925b1ead712a073670600781ab23a2b9 100644 (file)
@@ -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)
 
 {
index c1e17b3d3982e170eaaa8a3c717c7475e1567e04..2acc928d192062a7c50089c5dce154189bfaa923 100644 (file)
@@ -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)
 {
index 47769d2359d6f6b2a9b81e52d6158842ac87f8cf..595034cfb85aa34cfad606da9e2a458b16a3f23a 100644 (file)
@@ -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];
index c907601e44db093d5a3c594ec75c88ca307ed615..7d10074b3304616cc983f316c2fad491bbb90fc4 100644 (file)
@@ -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)
 
 {
index 45eb225ec25ee036d3bdf7dbaed9fd2a1bd136bb..1e0ccfaf403e8f88fb660748cefe9fe652e5c2ef 100644 (file)
@@ -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)
 {