On 26 September 2013 05:55, Colin Cross ccross@google.com wrote:
I don't agree with this. This patch is a tiny optimization in code that is rarely called, and it moves a final sanity check somewhere that it might get missed if the code were later refactored.
This is what we are doing for the first cpu of coupled-cpus: if (WARN_ON(!cpumask_equal(&dev->coupled_cpus, &dev->coupled_cpus))) coupled->prevent++;
i.e. comparing a variable to itself :)
And I believe my patch puts the sanity check at the right place (where we are using coupled from existing CPUs.. And that is where it should have been since the beginning)..
If people miss this during code re-factoring, then it would be even more stupid on the part of Author and Reviewer.. And if it still gets missed then this is not the only place where we need to worry about such stuff..
This is present everywhere in our code.. You can't really some part of code to some place and leave the other as-is.. The change is supposed to be more logical and so funny mistakes must be caught during reviews.