lkml.org 
[lkml]   [2020]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 2/5] seqlock: Use unique prefix for seqcount_t property accessors
On Fri, Aug 28, 2020 at 03:07:07AM +0200, Ahmed S. Darwish wrote:
> Differentiate the first group by using "__seqcount_t_" as prefix. This
> also conforms with the rest of seqlock.h naming conventions.

> #define __seqprop_case(s, locktype, prop) \
> seqcount_##locktype##_t: __seqcount_##locktype##_##prop((void *)(s))
>
> #define __seqprop(s, prop) _Generic(*(s), \
> - seqcount_t: __seqcount_##prop((void *)(s)), \
> + seqcount_t: __seqcount_t_##prop((void *)(s)), \
> __seqprop_case((s), raw_spinlock, prop), \
> __seqprop_case((s), spinlock, prop), \
> __seqprop_case((s), rwlock, prop), \

If instead you do:

#define __seqprop_case(s, _lockname, prop) \
seqcount##_lockname##_t: __seqcount##_lockname##_##prop((void *)(s))

You can have:

__seqprop_case((s), , prop),
__seqprop_case((s), _raw_spinlock, prop),
__seqprop_case((s), _spinlock, prop),
__seqprop_case((s), _rwlock, prop),
__seqprop_case((s), _mutex, prop),
__seqprop_case((s), _ww_mutex, prop),

And it's all good again.

Although arguably we should do something like s/__seqcount/__seqprop/
over this lot.


\
 
 \ /
  Last update: 2020-08-28 10:29    [W:0.227 / U:2.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site