From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>,
StefanoStabellini <stefano.stabellini@citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] Xen/atomic: use static inlines instead of macros
Date: Mon, 24 Feb 2014 10:26:06 +0000 [thread overview]
Message-ID: <530B1E3E.6040805@citrix.com> (raw)
In-Reply-To: <530B26BC020000780011EA65@nat28.tlf.novell.com>
On 24/02/14 10:02, Jan Beulich wrote:
>>>> On 21.02.14 at 21:41, Andrew Cooper <andrew.cooper3@citrix.com> 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 immediatly obvious is that the non-atomic varients
>> take
>> their atomic_t at a different level of indirection to the atomic varients.
>>
>> 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().
> Did you consider leaving these "non-atomic atomic ops" untouched
> (as they don't involve macro nesting), altering only the "real" ones?
>
> Jan
>
Yes, but for the sake of three updates at callsites, I felt the benefits
outweighed the costs.
~Andrew
next prev parent reply other threads:[~2014-02-24 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 20:41 [PATCH] Xen/atomic: use static inlines instead of macros Andrew Cooper
2014-02-24 10:02 ` Jan Beulich
2014-02-24 10:26 ` Andrew Cooper [this message]
2014-02-24 10:54 ` Jan Beulich
2014-02-24 11:29 ` Andrew Cooper
2014-02-24 11:50 ` Ian Campbell
2014-02-24 11:59 ` Andrew Cooper
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=530B1E3E.6040805@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.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.