All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, ehabkost@redhat.com,
	Richard Henderson <richard.henderson@liaro.org>
Subject: Re: [PATCH 6/8] include/qemu/lockable: Use _Generic instead of QEMU_GENERIC
Date: Mon, 14 Jun 2021 07:47:46 -0700	[thread overview]
Message-ID: <35b0ac31-9f7a-cd0d-cd28-2306ad0f9790@linaro.org> (raw)
In-Reply-To: <7a2d107e-40f0-f1aa-fb38-f1c4f7a9186b@redhat.com>

On 6/14/21 4:14 AM, Paolo Bonzini wrote:
> On 12/06/21 01:33, Richard Henderson wrote:
>> -                 unknown_lock_type))
>> +/* Auxiliary macros to simplify QEMU_MAKE_LOCABLE.  */
>> +#define QEMU_LOCK_FUNC(x) ((QemuLockUnlockFunc *)      \
>> +    _Generic((x), QemuMutex *: qemu_mutex_lock,        \
>> +                  QemuRecMutex *: qemu_rec_mutex_lock, \
>> +                  CoMutex *: qemu_co_mutex_lock,       \
>> +                  QemuSpin *: qemu_spin_lock))
>> +
>> +#define QEMU_UNLOCK_FUNC(x) ((QemuLockUnlockFunc *)      \
>> +    _Generic((x), QemuMutex *: qemu_mutex_unlock,        \
>> +                  QemuRecMutex *: qemu_rec_mutex_unlock, \
>> +                  CoMutex *: qemu_co_mutex_unlock,       \
>> +                  QemuSpin *: qemu_spin_unlock))
> 
> These are not needed anymore, are they?
> 
> Otherwise I agree that it's both more and less complicated.  The duplication between 
> QEMU_MAKE_LOCKABLE_NONNULL and QEMU_MAKE_LOCKABLE is tolerable.

Yep, I didn't notice that they were only used by MAKE_LOCKABLE.

r~



  reply	other threads:[~2021-06-14 14:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11 23:33 [PATCH 0/8] configure: Change to -std=gnu11 Richard Henderson
2021-06-11 23:33 ` [PATCH 1/8] configure: Use -std=gnu11 Richard Henderson
2021-06-15  7:42   ` Thomas Huth
2021-06-11 23:33 ` [PATCH 2/8] softfloat: Use _Generic instead of QEMU_GENERIC Richard Henderson
2021-06-11 23:33 ` [PATCH 3/8] util: Use real functions for thread-posix QemuRecMutex Richard Henderson
2021-06-11 23:33 ` [PATCH 4/8] util: Pass file+line to qemu_rec_mutex_unlock_impl Richard Henderson
2021-06-11 23:33 ` [PATCH 5/8] util: Use unique type for QemuRecMutex in thread-posix.h Richard Henderson
2021-06-11 23:33 ` [PATCH 6/8] include/qemu/lockable: Use _Generic instead of QEMU_GENERIC Richard Henderson
2021-06-14 11:14   ` Paolo Bonzini
2021-06-14 14:47     ` Richard Henderson [this message]
2021-06-11 23:33 ` [PATCH 7/8] qemu/compiler: Remove QEMU_GENERIC Richard Henderson
2021-06-11 23:33 ` [PATCH 8/8] configure: Remove probe for _Static_assert Richard Henderson
2021-06-11 23:36 ` [PATCH 0/8] configure: Change to -std=gnu11 Richard Henderson
2021-06-14 11:15 ` Paolo Bonzini
2021-06-14 22:38 ` no-reply

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=35b0ac31-9f7a-cd0d-cd28-2306ad0f9790@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@liaro.org \
    --cc=thuth@redhat.com \
    /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.