Re: [patch 3/3] x86: io-apic - code style cleaning for setup_IO_APIC_irqs

Cyrill Gorcunov
2008-09-06T19:04:57Z

[Maciej W. Rozycki - Sat, Sep 06, 2008 at 07:45:08PM +0100]
| On Sat, 6 Sep 2008, Cyrill Gorcunov wrote:
|
| > Ingo, how about the following approach? We don't introduce new
| > functions but rather srink the code by new printout form.
|
| Honestly, this one should probably use sprintf() or suchlike to avoid the
| mess of printk() calls building a line of output from pieces. It's quite
| easy to calculate here what the maximum size of the buffer required could
| be and automatic arrays can have variable size, so no need for the hassle
| of heap management. Calls to printk() without a trailing newline should
| be avoided where possible as it messes up logging priority if a message
| pops up from an interrupt inbetween.
|
| Maciej
|

The easiest way would be just print this info on separate
lines like

IO-APIC (apicid-pin) 1-1 not connected

and just drop all this troubles :)

I'm not sure how much memory we need for every io-apic
pins - iirc there only 32 redirection entry so it could
be about 32 bytes from stack would be enough. Will take
a look. Thanks Maciej! Ingo?

Btw, i think the problem is rather with (as Ingo mentoined)
too nesting cycles - so maybe we could use an iterator
for this? Maybe rcu based? As I see these global variables
are not supposed to be changed during iterations and if that
happens in future we could achieve rcu complains about it
and this prevent us for possible bug. Opinions? (just
a thoughts)

- Cyrill -