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

2007-11-29 Thread Lennert Buytenhek
On Thu, Nov 29, 2007 at 02:07:06AM +0100, Roel Kluin wrote:

> in include/asm-arm/arch-omap/board-innovator.h:40
> #define NR_IRQSIH_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.
> --
> Add parentheses to prevent operator precedence errors
> 
> Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>

Acked-by: Lennert Buytenhek <[EMAIL PROTECTED]>

Please send to the ARM patch system.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-11-29 Thread Lennert Buytenhek
On Thu, Nov 29, 2007 at 02:07:06AM +0100, Roel Kluin wrote:

 in include/asm-arm/arch-omap/board-innovator.h:40
 #define NR_IRQSIH_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.
 --
 Add parentheses to prevent operator precedence errors
 
 Signed-off-by: Roel Kluin [EMAIL PROTECTED]

Acked-by: Lennert Buytenhek [EMAIL PROTECTED]

Please send to the ARM patch system.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-11-28 Thread Roel Kluin
Roel Kluin wrote:
> Add parentheses to prevent operator precedence errors
> 
> Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>

For the arch-ixp23xx part I should have added:
Acked-by: Lennert Buytenhek <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-11-28 Thread Roel Kluin
in include/asm-arm/arch-omap/board-innovator.h:40
#define NR_IRQSIH_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.
--
Add parentheses to prevent operator precedence errors

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
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_IRQSNR_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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-11-28 Thread Roel Kluin
in include/asm-arm/arch-omap/board-innovator.h:40
#define NR_IRQSIH_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.
--
Add parentheses to prevent operator precedence errors

Signed-off-by: Roel Kluin [EMAIL PROTECTED]
---
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_IRQSNR_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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-11-28 Thread Roel Kluin
Roel Kluin wrote:
 Add parentheses to prevent operator precedence errors
 
 Signed-off-by: Roel Kluin [EMAIL PROTECTED]

For the arch-ixp23xx part I should have added:
Acked-by: Lennert Buytenhek [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/