Re: [patch 2/2] lockdep: initialize lockdep debugging statistics

From: David Rientjes
Date: Fri Mar 06 2009 - 05:27:47 EST


On Fri, 6 Mar 2009, Peter Zijlstra wrote:

> > Peter, this is purely a matter of good software engineering practices.
>
> For complex types I would agree, but atomic_t is assumed to be just
> another int - just with special ops. For such things we can hold that
> memset('0') will properly initialize them to their 0 value.
>

That's the point about good software engineering practices: atomic_t
should not be assumed to be another int. If its implementation were ever
to change even for a single architecture, so would these variable
declarations.

> > I assume you wouldn't object to removing all such cases in the kernel.
> >
> > $ grep -r "atomic_t.*= ATOMIC_INIT(0)" * | wc -l
> > 104
>
> Only IFF all those cases are for static/global storage.

They are.

Anyway, I've already deferred to your maintainership of lockdep about not
wanting to initialize global atomics in this part of the kernel, so while
I disagree with it from a software engineering perspective, I think I'll
be able to move on.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/