lkml.org 
[lkml]   [2013]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] [RFC] net: Explicitly initialize u64_stats_sync structures for lockdep
From
Date
On Fri, 2013-09-27 at 07:44 +0200, Ingo Molnar wrote:

> C cannot pass along symbolic names, unfortunately, so we are stuck with
> 1970's tech and the C preprocessor.
>

Yes, I realized that a bit too late.

> There's a way to make such macros look a tiny bit more structured and thus
> be more palatable:
>
> #if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
> # define u64_stats_init(syncp) seqcount_init(syncp.seq)
> #else
> # define u64_stats_init(syncp)
> #endif
>
> Note, the 'else' branch should probably be:
>
> # define u64_stats_init(syncp) do { } while (0)

Yes, this is better ;)

Thanks !




\
 
 \ /
  Last update: 2013-09-27 12:01    [W:0.051 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site