All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v2 3/6] thread.h: Remove trailing semicolons from Coverity qemu_mutex_lock() etc
Date: Sun, 22 Mar 2020 11:41:24 +0100	[thread overview]
Message-ID: <1e1e971d-2725-d4d3-d9f3-b4c7ca6d6bc0@redhat.com> (raw)
In-Reply-To: <20200319193323.2038-4-peter.maydell@linaro.org>

On 3/19/20 8:33 PM, Peter Maydell wrote:
> All the Coverity-specific definitions of qemu_mutex_lock() and friends
> have a trailing semicolon. This works fine almost everywhere because
> of QEMU's mandatory-braces coding style and because most callsites are
> simple, but target/s390x/sigp.c has a use of qemu_mutex_trylock() as
> an if() statement, which makes the ';' a syntax error:
> "../target/s390x/sigp.c", line 461: warning #18: expected a ")"
>        if (qemu_mutex_trylock(&qemu_sigp_mutex)) {
>            ^
> 
> Remove the bogus semicolons from the macro definitions.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   include/qemu/thread.h | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/qemu/thread.h b/include/qemu/thread.h
> index 10262c63f58..d22848138ea 100644
> --- a/include/qemu/thread.h
> +++ b/include/qemu/thread.h
> @@ -57,17 +57,17 @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func;
>    * hide them.
>    */
>   #define qemu_mutex_lock(m)                                              \
> -            qemu_mutex_lock_impl(m, __FILE__, __LINE__);
> +            qemu_mutex_lock_impl(m, __FILE__, __LINE__)
>   #define qemu_mutex_trylock(m)                                           \
> -            qemu_mutex_trylock_impl(m, __FILE__, __LINE__);
> +            qemu_mutex_trylock_impl(m, __FILE__, __LINE__)
>   #define qemu_rec_mutex_lock(m)                                          \
> -            qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__);
> +            qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__)
>   #define qemu_rec_mutex_trylock(m)                                       \
> -            qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__);
> +            qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__)
>   #define qemu_cond_wait(c, m)                                            \
> -            qemu_cond_wait_impl(c, m, __FILE__, __LINE__);
> +            qemu_cond_wait_impl(c, m, __FILE__, __LINE__)
>   #define qemu_cond_timedwait(c, m, ms)                                   \
> -            qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__);
> +            qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__)
>   #else
>   #define qemu_mutex_lock(m) ({                                           \
>               QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func);  \
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



  parent reply	other threads:[~2020-03-22 10:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 19:33 [PATCH v2 0/6] Automation of Coverity Scan uploads (via Docker) Peter Maydell
2020-03-19 19:33 ` [PATCH v2 1/6] osdep.h: Drop no-longer-needed Coverity workarounds Peter Maydell
2020-03-20 17:17   ` Richard Henderson
2020-03-19 19:33 ` [PATCH v2 2/6] thread.h: Fix Coverity version of qemu_cond_timedwait() Peter Maydell
2020-03-20 17:18   ` Richard Henderson
2020-03-22 10:42   ` Philippe Mathieu-Daudé
2020-03-19 19:33 ` [PATCH v2 3/6] thread.h: Remove trailing semicolons from Coverity qemu_mutex_lock() etc Peter Maydell
2020-03-20 17:18   ` Richard Henderson
2020-03-22 10:41   ` Philippe Mathieu-Daudé [this message]
2020-03-19 19:33 ` [PATCH v2 4/6] linux-user/flatload.c: Use "" for include of QEMU header target_flat.h Peter Maydell
2020-03-20 17:19   ` Richard Henderson
2020-03-22 10:41   ` Philippe Mathieu-Daudé
2020-03-19 19:33 ` [PATCH v2 5/6] scripts/run-coverity-scan: Script to run Coverity Scan build Peter Maydell
2020-04-14 12:14   ` Philippe Mathieu-Daudé
2020-03-19 19:33 ` [PATCH v2 6/6] scripts/coverity-scan: Add Docker support Peter Maydell
2020-03-20 17:41   ` Paolo Bonzini
2020-04-14 11:58   ` Philippe Mathieu-Daudé
2020-04-14 12:11     ` Philippe Mathieu-Daudé
2020-04-15 12:27     ` Peter Maydell
2020-04-13 12:13 ` [PATCH v2 0/6] Automation of Coverity Scan uploads (via Docker) Peter Maydell
2020-04-13 12:40   ` Paolo Bonzini

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=1e1e971d-2725-d4d3-d9f3-b4c7ca6d6bc0@redhat.com \
    --to=philmd@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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.