Skip to contentSkip to conversation

db1550: useless memset() call

PATCH In review kbaidarov 2 participants 2 messages Sep 22, 2005 – Oct 3, 2005 MIPS

lore
Share & tools
lore

kbaidarov

author
#0 lore raw

PATCH 1/1 db1550: useless memset() call

I've try kernel without memset() on the board - is ok, board boot. All drivers works fine. Than I grep the kernel sources:

[root@windmill linux]# grep -nri "memset(irq_desc" arch/
arch/mips/au1000/common/irq.c:449: memset(irq_desc, 0, sizeof(irq_desc));
arch/mips/ite-boards/generic/irq.c:184: memset(irq_desc, 0, sizeof(irq_desc));
[root@windmill linux]#

Only 2 matches! Does we needs memset() at all?
And if some one try to initialize irq_desc from start_kernel() before arch_init_irq() call, then following arch_init_irq() call discard all that initialization.

Description:
Removes useless memset() call.

linux/arch/mips/au1000/common/irq.c +0 -1
Index: linux_up/linux/arch/mips/au1000/common/irq.c
===================================================================
@@ -446,7 +446,6 @@ void __init arch_init_irq(void)
 	extern int au1xxx_ic0_nr_irqs;
 
 	cp0_status = read_c0_status();
-	memset(irq_desc, 0, sizeof(irq_desc));
 	set_except_vector(0, au1000_IRQ);
 
 	/* Initialize interrupt controllers to a safe state.
#1 lore raw
Quoted 10 lines · kbaidarov

I've try kernel without memset() on the board - is ok, board boot. All drivers works fine. Than I grep the kernel sources:

[root@windmill linux]# grep -nri "memset(irq_desc" arch/
arch/mips/au1000/common/irq.c:449: memset(irq_desc, 0,
sizeof(irq_desc));
arch/mips/ite-boards/generic/irq.c:184: memset(irq_desc, 0,
sizeof(irq_desc));
[root@windmill linux]#

Quoted 4 lines

Only 2 matches! Does we needs memset() at all?
And if some one try to initialize irq_desc from start_kernel() before arch_init_irq() call, then following arch_init_irq() call discard all that initialization.

Exactly, so the initialization is wrong, so I'm removing both calls.

Thanks,

Ralf