On Wed, Feb 18, 2015 at 2:47 PM, Julius Werner <jwerner@chromium.org> wrote:
> I think nobody disagrees that type checking is a bad idea here.

I ain't not unsure that you failed to not make no mistake with the
missing lack of double negatives there... ;)

> I don't think this argument makes sense for code that is being actively
> developed in other code bases and imported into coreboot. Of course, if
> you're importing stable code and don't expect much churn, tidying things up
> is a fine idea. But increasing deltas while a project is still under active
> development only serves to make integration and maintenance efforts more
> troublesome and prone to error. It's not a productive use of anyone's time
> when there are real bugs to solve.
>
> Vendors often have code which they have already qualified and are
> understandably reluctant to make any changes to it, even trivial aesthetic
> ones. I'd like to make it easier for them to contribute directly to
> coreboot, and throwing up artificial barriers does not help them gain
> traction.

Do we really want to facilitate more of these wholesale imports of
untouched, existing code dumps from other sources into coreboot?

I don't think that's necessarily a bad thing during heavy development. Obviously we'd want to tidy things up after the fact and use wrappers until then, but insofar as this whole write32/writel and arg ordering discussion goes there hasn't been much to aspire to in terms of tidying things.

So basically what I'm advocating is to define a "proper" approach that we apply to coreboot in general, while being flexible about importing code. Once we define the proper approach, then applying an spatch to bring the style into conformance and remove the scaffolding should be relatively painless.

It
seems to me that those always end up bad for us... code is hard to
read and follow because of switched conventions,

Yep. And for the person porting the code, switching conventions on-the-fly might be even more confusing. I generally like to see code working before making such changes.
 
it could have
depended on different requirements for the environment than what
coreboot provides, it often includes a lot of hacky and
overcomplicated code that the original use case might have needed but
we don't, people will end up making changes after the import that
desync it with the source, etc.

True, and I think it's more productive to prioritize fixing those issues over aesthetic ones.

I'm all for re-factoring code. I just don't think forcing huge deltas from the get-go during heavy development is a great way to do it.
 
I think for small stuff like
individual drivers we're better off just rewriting them with a sound
design from the ground up tailored to our use case (at least that
guarantees that someone really understood and thought through how it
all works within the coreboot context).

Agreed - For small stuff I'm totally on-board.

That might not be the case, however, for more complicated stuff.  For example, if a vendor updates DRAM init code in u-boot multiple times over a period of weeks/months and we need to apply the same updates to coreboot, having hundreds of cosmetic changes show up in the diff just makes the porting process more difficult and more prone to error.
 
For really large scale
external imports (like AMD Agesa), we can stow it away in vendorcode/
with translator headers to allow it to keep its own conventions
completely unchanged, without risk of it leaking out into the rest of
coreboot.

Yep.

--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.