+ i386-i8259c-simplify-i8259a_irq_real.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     i386: i8259.c: simplify i8259A_irq_real()

has been added to the -mm tree.  Its filename is

     i386-i8259c-simplify-i8259a_irq_real.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this


From: Andreas Mohr <andi@xxxxxxxxxxxxxxxxxxxxxxx>

I noticed the very "non-nice" asymmetry of i8259A_irq_real(), so I decided
to fix the weirdly aligned branches.

While doing this, I noticed that it could be streamlined much more,
resulting in an astonishing 208 byte object code saving for such a tiny
code fragment!  (gcc 3.2.3)

Signed-off-by: Andreas Mohr <andi@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/i8259.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff -puN arch/i386/kernel/i8259.c~i386-i8259c-simplify-i8259a_irq_real arch/i386/kernel/i8259.c
--- 25/arch/i386/kernel/i8259.c~i386-i8259c-simplify-i8259a_irq_real	Thu Apr 27 16:27:26 2006
+++ 25-akpm/arch/i386/kernel/i8259.c	Thu Apr 27 16:27:26 2006
@@ -145,17 +145,20 @@ void make_8259A_irq(unsigned int irq)
 static inline int i8259A_irq_real(unsigned int irq)
 {
 	int value;
-	int irqmask = 1<<irq;
+	int irqmask;
+	int reg;
 
 	if (irq < 8) {
-		outb(0x0B,PIC_MASTER_CMD);	/* ISR register */
-		value = inb(PIC_MASTER_CMD) & irqmask;
-		outb(0x0A,PIC_MASTER_CMD);	/* back to the IRR register */
-		return value;
+		reg = PIC_MASTER_CMD;
+		irqmask = 1 << irq;
+	} else {
+		reg = PIC_SLAVE_CMD;
+		irqmask = 1 << (irq - 8);
 	}
-	outb(0x0B,PIC_SLAVE_CMD);	/* ISR register */
-	value = inb(PIC_SLAVE_CMD) & (irqmask >> 8);
-	outb(0x0A,PIC_SLAVE_CMD);	/* back to the IRR register */
+
+	outb(0x0B, reg);	/* ISR register */
+	value = inb(reg) & irqmask;
+	outb(0x0A, reg);	/* back to the IRR register */
 	return value;
 }
 
_

Patches currently in -mm which might be from andi@xxxxxxxxxxxxxxxxxxxxxxx are

acpi-idle-__read_mostly-and-de-init-static-var.patch
acx1xx-wireless-driver.patch
i386-apmc-optimization.patch
i386-i8259c-simplify-i8259a_irq_real.patch
x86-powerpc-make-hardirq_ctx-and-softirq_ctx-__read_mostly.patch
make-noirqdebug-irqfixup-__read_mostly-add-unlikely.patch
make-pmtmr_ioport-__read_mostly.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux