lkml.org 
[lkml]   [2005]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
From
Date
On Thu, 2005-12-15 at 21:20 +0300, Nikita Danilov wrote:

> Going off at a tangent (or tangle, rather), why do we need DECLARE_FOO()
> macros at all? They
>
> - do not look like C variable declarations, hide variable type, and
> hence are confusing,
>
> - contrary to their naming actually _define_ rather than _declare_ an
> object.
>
> In most cases
>
> type var = INIT_FOO;
>
> is much better (more readable and easier to understand) than
>
> DECLARE_FOO(var); /* what is the type of var? */
>
> In the cases where initializer needs an address of object being
> initialized
>
> type var = INIT_FOO(var);
>
> can be used.

That's just error prone. In the RT patch we had several bugs caused by
cut and paste errors like:

type foo = INIT_TYPE(foo);
type bar = INIT_TYPE(foo);

These are not always easy to find.

-- Steve


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-15 22:01    [W:0.607 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site