[PATCH] asm-arm/{arch-omap,arch-ixp23xx}: parentheses around NR_IRQS definition

[PATCH] asm-arm/{arch-omap,arch-ixp23xx}: parentheses around NR_IRQS definition

Post by Roel Klui » Fri, 30 Nov 2007 10:10:07


in include/asm-arm/arch-omap/board-innovator.h:40
#define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS

in include/asm-arm/arch-ixp23xx/irqs.h:156:
#define NR_IRQS NR_IXP23XX_IRQS + NR_IXP23XX_MACH_IRQS

This could lead to problems when this definition is used in:

arch/ia64/sn/kernel/irq.c:516:
sn_irq_lh = kmalloc(sizeof(struct list_head *) * NR_IRQS, GFP_KERNEL);
arch/x86/kernel/io_apic_32.c:693:
irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
694:
irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
699:
memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS);
700:
memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS);
fs/proc/proc_misc.c:464:
per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);

I am not sure whether this definition actually is used in any of these files.
Am I being paranoya? anyway, adding parentheses should be safe.
Signed-off-by: Roel Kluin < XXXX@XXXXX.COM >
---
diff --git a/include/asm-arm/arch-ixp23xx/irqs.h b/include/asm-arm/arch-ixp23xx/irqs.h
index e696395..27c5808 100644
--- a/include/asm-arm/arch-ixp23xx/irqs.h
+++ b/include/asm-arm/arch-ixp23xx/irqs.h
@@ -153,7 +153,7 @@
*/
#define NR_IXP23XX_MACH_IRQS 32

-#define NR_IRQS NR_IXP23XX_IRQS + NR_IXP23XX_MACH_IRQS
+#define NR_IRQS (NR_IXP23XX_IRQS + NR_IXP23XX_MACH_IRQS)

#define IXP23XX_MACH_IRQ(irq) (NR_IXP23XX_IRQ + (irq))

diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h
index b3cf334..56d2c98 100644
--- a/include/asm-arm/arch-omap/board-innovator.h
+++ b/include/asm-arm/arch-omap/board-innovator.h
@@ -37,7 +37,7 @@
#define OMAP1510P1_EMIFF_PRI_VALUE 0x00

#define NR_FPGA_IRQS 24
-#define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS
+#define NR_IRQS (IH_BOARD_BASE + NR_FPGA_IRQS)

#ifndef __ASSEMBLY__
void fpga_write(unsigned char val, int reg);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. [PATCH 09/11] Get rid of verify_area() - arch/ppc/, arch/ppc64/, arch/m68k/, arch/m68knommu/.

2. WTF is include/asm-arm/arch-s3c2410/system.h ?

Can anyone please explain the contents of
include/asm-arm/arch-s3c2410/system.h ?

This file looks like a C file accidentially named .h ...

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH] arch/arm/Kconfig: Make UIO available on ARM architecture

4. [PATCH 04/36] UIO: arch/arm/Kconfig: Make UIO available on ARM architecture

5. [md-accel PATCH 19/19] ARM: Add drivers/dma to arch/arm/Kconfig

6. [PATCH] ARM: (trivial) fix format warning in arch/arm/mm/init.c

7. [PATCH] arch/arm/Kconfig: Make UIO available on ARM architecture

8. [PATCH] ARM: Fixup missing includes in arch/arm/mm/proc-<cputype>.S

9. [PATCH 2.6.21-rc4 02/15] ARM: Add drivers/dma to arch/arm/Kconfig

10. [PATCH] Possible memory leak in arch/cris/arch-v32/drivers/cryptocop.c

11. [PATCH] replace "make ARCH=i386/x86_64 with make ARCH=x86"

12. [PATCH] Allow arch to initialize arch field of the module structure

13. [PATCH 27/32] Blackfin arch: add board default configs to blackfin arch

14. [PATCH] Possible memory leak in arch/cris/arch-v32/drivers/cryptocop.c

15. [PATCH 8/21] KGDB: This adds basic KGDB support for both arch/ppc and arch/powerpc.