qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: "Richard Henderson" <rth@twiddle.net>,
	"Emilio G. Cota" <cota@braap.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Sergey Fedorov" <sergey.fedorov@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1/1] seqlock: Fix warning reg. incompatible cast
Date: Sat,  6 Aug 2016 21:41:21 -0400	[thread overview]
Message-ID: <20160807014121.18739-1-bobby.prani@gmail.com> (raw)

With the latest clang, we have the following warning. We are not using
the const qualifier consistently in other functions. So remove it from
the only one that uses it to fix the warning.

/home/pranith/devops/code/qemu/include/qemu/seqlock.h:62:21: warning: passing 'typeof (*&sl->sequence) *' (aka 'const unsigned int *') to parameter of type 'unsigned int *' discards qualifier
s [-Wincompatible-pointer-types-discards-qualifiers]
    return unlikely(atomic_read(&sl->sequence) != start);
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pranith/devops/code/qemu/include/qemu/atomic.h:58:25: note: expanded from macro 'atomic_read'
     __atomic_load(ptr, &_val, __ATOMIC_RELAXED);     \
                        ^~~~~
/home/pranith/devops/code/qemu/include/qemu/compiler.h:62:43: note: expanded from macro 'unlikely'
#define unlikely(x)   __builtin_expect(!!(x), 0)

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 include/qemu/seqlock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qemu/seqlock.h b/include/qemu/seqlock.h
index 2e2be4c..aa4cf15 100644
--- a/include/qemu/seqlock.h
+++ b/include/qemu/seqlock.h
@@ -55,7 +55,7 @@ static inline unsigned seqlock_read_begin(QemuSeqLock *sl)
     return ret & ~1;
 }
 
-static inline int seqlock_read_retry(const QemuSeqLock *sl, unsigned start)
+static inline int seqlock_read_retry(QemuSeqLock *sl, unsigned start)
 {
     /* Read other fields before reading final sequence.  */
     smp_rmb();
-- 
2.9.2

             reply	other threads:[~2016-08-07  1:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-07  1:41 Pranith Kumar [this message]
2016-08-08  9:05 ` [Qemu-devel] [PATCH 1/1] seqlock: Fix warning reg. incompatible cast Paolo Bonzini
2016-08-08  9:27   ` Paolo Bonzini
2016-08-08  9:55     ` Paolo Bonzini
2016-08-08 10:00       ` Richard Henderson
2016-08-08 10:02         ` Paolo Bonzini
2016-08-08 10:25           ` Richard Henderson

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=20160807014121.18739-1-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sergey.fedorov@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).