All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/6] qemu/queue.h: leave head structs anonymous unless necessary
Date: Fri, 7 Dec 2018 14:47:47 +0100	[thread overview]
Message-ID: <3d8d2f30-d926-15d0-c8d3-b1a5f52ba1d6@redhat.com> (raw)
In-Reply-To: <87ftv93ie6.fsf@dusky.pond.sub.org>

On 07/12/18 08:28, Markus Armbruster wrote:
> 
>     $ git-grep 'Q[A-Z]*_HEAD([^,]' | grep -v '#define' | grep -v QTAILQ_HEAD
>     block/qcow2-bitmap.c:typedef QSIMPLEQ_HEAD(Qcow2BitmapList, Qcow2Bitmap) Qcow2BitmapList;
>     include/block/block.h:typedef QSIMPLEQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue;
>     include/hw/vfio/vfio-common.h:typedef QLIST_HEAD(VFIOGroupList, VFIOGroup) VFIOGroupList;
>     qemu-bridge-helper.c:typedef QSIMPLEQ_HEAD(ACLList, ACLRule) ACLList;
> 
> Are these four names left in intentionally?

Yes, they are the ones which are used in extern global variables or in
function parameters.  If they are static variables or struct fields, on
the other hand, you don't need the typedef.

The same is also true of the handful of QTAILQ head structs that are
typedefed in 3/6.

I'll add this to the commit message.

> If the name is indeed not needed for lists of other kinds, should we
> simplify the macros so their users don't have to supply an empty first
> argument?

No, it's just a coincidence.  For example QTAILQ needs it (patch 3/6).

Paolo

  reply	other threads:[~2018-12-07 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 23:23 [Qemu-devel] [PATCH for-4.0 0/6] qemu/queue.h usage cleanup, improved QTAILQ API Paolo Bonzini
2018-12-06 23:23 ` [Qemu-devel] [PATCH 1/6] qemu/queue.h: do not access tqe_prev directly Paolo Bonzini
2018-12-07  7:14   ` Markus Armbruster
2018-12-07 10:14   ` Philippe Mathieu-Daudé
2018-12-06 23:23 ` [Qemu-devel] [PATCH 2/6] qemu/queue.h: leave head structs anonymous unless necessary Paolo Bonzini
2018-12-07  7:28   ` Markus Armbruster
2018-12-07 13:47     ` Paolo Bonzini [this message]
2018-12-06 23:23 ` [Qemu-devel] [PATCH 3/6] qemu/queue.h: typedef QTAILQ heads Paolo Bonzini
2018-12-07  7:30   ` Markus Armbruster
2018-12-07 10:15   ` Philippe Mathieu-Daudé
2018-12-06 23:23 ` [Qemu-devel] [PATCH 4/6] qemu/queue.h: reimplement QTAILQ without pointer-to-pointers Paolo Bonzini
2018-12-07  9:22   ` Markus Armbruster
2018-12-06 23:23 ` [Qemu-devel] [PATCH 5/6] qemu/queue.h: simplify reverse access to QTAILQ Paolo Bonzini
2018-12-06 23:23 ` [Qemu-devel] [PATCH 6/6] checkpatch: warn about queue/queue.h head structs that are not typedef-ed Paolo Bonzini
2018-12-07  9:02   ` Markus Armbruster
2018-12-07 13:49     ` 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=3d8d2f30-d926-15d0-c8d3-b1a5f52ba1d6@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --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.