On 10.04.2008 04:03, Ward Vandewege wrote:
On Thu, Apr 10, 2008 at 03:44:35AM +0200, Carl-Daniel Hailfinger wrote:
On 10.04.2008 03:06, Ward Vandewege wrote:
This one is largely thanks to Marc. Mostly written during the summit in Denver. It depends on the dts patch I just sent.
All errors are my own of course!
- /* disable unwanted virtual PCI devices */
- int i;
Maybe move the int i; declaration inside the for statement? That makes the scope more obvious and has the added benefit of possibly conserving stack space (if other loops do the same). Yes, I know this is C99 only, but we have other uses for C99 which enables some cleanups.
That doesn't work:
southbridge/amd/cs5536/cs5536.c:652: error: ‘for’ loop initial declaration used outside C99 mode
Suggestions?
Use the -std=gnu99 gcc parameter. Anyway, usage of C99 features is probably best left to another patch, so feel free to ignore that request of mine for now.
- for (i = 0; 0 != (char *)(sb->unwanted_vpci[i]); i = i+4) {
Ugh. What exactly are you trying to do? This looks wrong on so many levels. Wouldn't the following line be more correct?
for (int i = 0; sb->unwanted_vpci[i]; i++) {
You're right of course, much better that way (minus the int declaration). My line just happened to match the first entry but was plain wrong...
Fine. Now we just have to create a mergeable version of the dtc patch.
Regards, Carl-Daniel