From: Keir Fraser <keir.xen@gmail.com>
To: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH v2] Xen/atomic: use static inlines instead of macros
Date: Tue, 01 Apr 2014 11:39:22 +0100 [thread overview]
Message-ID: <533A975A.1060402@gmail.com> (raw)
In-Reply-To: <20140328112212.GA87844@deinos.phlegethon.org>
[-- Attachment #1.1: Type: text/plain, Size: 1227 bytes --]
Tim Deegan wrote:
>
> At 10:55 +0000 on 28 Mar (1396000508), Andrew Cooper wrote:
>>
>> This is some coverity-inspired tidying.
>>
>> Coverity has some grief analysing the call sites of atomic_read().
>> This is
>> believed to be a bug in Coverity itself when expanding the nested
>> macros, but
>> there is no legitimate reason for it to be a macro in the first place.
>>
>> This patch changes {,_}atomic_{read,set}() from being macros to being
>> static
>> inline functions, thus gaining some type safety.
>>
>> One issue which is not immediately obvious is that the non-atomic
>> variants take
>> their atomic_t at a different level of indirection to the atomic
>> variants.
>>
>> This is not suitable for _atomic_set() (when used to initialise an
>> atomic_t)
>> which is converted to take its parameter as a pointer. One callsite of
>> _atomic_set() is updated, while the other two callsites are updated to
>> ATOMIC_INIT().
>>
>> Signed-off-by: Andrew Cooper<andrew.cooper3@citrix.com>
>
>
> Reviewed-by: Tim Deegan<tim@xen.org>
>
> FWIW, I approve of converting both kinds of accessors to inlines, just
> on general principles.
Agreed, functions are preferable to macros.
Acked-by: Keir Fraser <keir@xen.org>
[-- Attachment #1.2: Type: text/html, Size: 1491 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-04-01 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 10:55 [PATCH v2] Xen/atomic: use static inlines instead of macros Andrew Cooper
2014-03-28 11:05 ` Jan Beulich
2014-03-28 11:23 ` Andrew Cooper
2014-03-28 11:22 ` Tim Deegan
2014-04-01 10:39 ` Keir Fraser [this message]
2014-04-01 10:11 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533A975A.1060402@gmail.com \
--to=keir.xen@gmail.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.