From: Peter Zijlstra <peterz@infradead.org>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: Code atomic[64]_read and atomic[64]_set in C not CPP
Date: Fri, 05 Jun 2009 14:18:40 +0200 [thread overview]
Message-ID: <1244204320.13761.4302.camel@twins> (raw)
In-Reply-To: <18984.63207.824631.459239@cargo.ozlabs.ibm.com>
On Fri, 2009-06-05 at 20:43 +1000, Paul Mackerras wrote:
> Occasionally we get bugs where atomic_read or atomic_set are used on
> atomic64_t variables or vice versa. These bugs don't generate
> warnings on x86 because atomic_read and atomic_set are coded as macros
> rather than C functions, so we don't get any type-checking on their
> arguments; similarly for atomic64_read and atomic64_set in 64-bit
> kernels.
>
> This converts them to C functions so that the arguments are
> type-checked and bugs like this will get caught more easily.
> It also converts atomic_cmpxchg and atomic_xchg, and atomic64_cmpxchg
> and atomic64_xchg on 64-bit, so we get type-checking on their
> arguments too.
>
> Compiling a typical 64-bit x86 config, this generates no new warnings,
> and the vmlinux text is 86 bytes smaller.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
Nice!
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
prev parent reply other threads:[~2009-06-05 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 10:43 Paul Mackerras
2009-06-05 12:18 ` Peter Zijlstra [this message]
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=1244204320.13761.4302.camel@twins \
--to=peterz@infradead.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®