Skip to contentSkip to conversation

Five year old bug found ;-)

parisc-linux Matthew Wilcox 1 participant 1 message Jan 21, 2005

lore
Share & tools
lore
#0 lore raw

OK, I tracked down the change ... it was merely 4 years, 3 months ago ;-)

In txn_alloc_data, we test the bit width:

- if ((virt_irq - CPU_IRQ_BASE) > (1 << (bits_wide - 1))) {
- panic("Sorry -- didn't allocate valid IRQ for this device\n");
- }

But the bracketing is wrong. GSC devices could only allocate up to 16 IRQs (1 << (5 - 1)). This should be 31, ((1 << bits_wide) - 1). Or even better, just use >= and it becomes:

	if ((virt_irq - CPU_IRQ_BASE) >= (1 << bits_wide))

Much more intuitive and easy to understand, IMO. Oh, and I'm rewriting this to get rid of the panic ... what's committed later will look slightly different to this.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux