[PATCH] PPC64: EEH Recovery
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Nov 23 13:37:20 EST 2004
> Ahh, I occasionally have to debug code that looks like
>
> if(a)
> if (b)
> x=y;
> else
> x=z;
>
> so I get cranky when I don't see braces. That, and the fact that I've
> helped other people debug code that had started life as
Of course, the above case would definitely require { } to be sane and
gcc would probably even warn about it.
> and so I have come to enjoy braces as a way of avoiding
> stupid-error-prone-human-errors. So what if its ugly, as long as
> it saves you time and trouble later?
Because it is ugly :) taste taste ...
> Heh :) Removing the pci device also causes all of the pointers in the
> device tree for that device to be nulled out, and so one looses the
> topology. So I had three bad choices:
Hrm... just keeping the domain/bus/devfn should be enough anyway
> 1) Change the device-remove code to not null-out the pointers.
> This seemed potentially dangerous, and might have unexpected
> side-effects. And worse: if someone, one day in the future,
> changed the code back to null out the pointers, my code would
> break. So I didn't do this.
>
> 2) Add pointers to the device tree which point to exactly the same
> things as other pointers in the device tree, but which aren't
> null'ed out during device delete. This seemed to lead to confusion:
> someday, someone will wonder why there are two sets of identical
> pointers in the struct, and "fix it".
>
> 3) create the structs I needed. Simple, easy, limited in scope to just
> that one file, doesn't have to be exposed externally ... seemed like
> such an easy idea. So that's what I did.
>
> --linas
--
Benjamin Herrenschmidt <benh at kernel.crashing.org>
More information about the Linuxppc64-dev
mailing list