[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 24/26] hw/usb/usb-hcd: Use UHCI type definitions
- To: BALATON Zoltan <balaton@xxxxxxxxxx>, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>
- From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
- Date: Sun, 5 Jul 2020 07:37:38 +0200
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@xxxxxxxxxx
- Cc: Peter Maydell <peter.maydell@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, Huacai Chen <chenhc@xxxxxxxxxx>, Eric Blake <eblake@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Magnus Damm <magnus.damm@xxxxxxxxx>, Markus Armbruster <armbru@xxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, Leif Lindholm <leif@xxxxxxxxxxxx>, Andrzej Zaborowski <balrogg@xxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, "Dr. David Alan Gilbert" <dgilbert@xxxxxxxxxx>, Beniamino Galvani <b.galvani@xxxxxxxxx>, Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>, Niek Linnenbank <nieklinnenbank@xxxxxxxxx>, qemu-arm@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Richard Henderson <rth@xxxxxxxxxxx>, Radoslaw Biernacki <radoslaw.biernacki@xxxxxxxxxx>, Igor Mitsyanko <i.mitsyanko@xxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Paul Zimmerman <pauldzim@xxxxxxxxx>, qemu-ppc@xxxxxxxxxx, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Sun, 05 Jul 2020 05:38:07 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 04/07/20 21:44, BALATON Zoltan wrote:
>
> No it's OK, no need to list all defines. I just did not notice the macro
> argument that's why I was wondering where it comes from. This seems to
> be used elsewhere at least here:
>
> hw/audio/es1370.c:#define a(n) if (val & CTRL_##n) strcat (buf, " "#n)
> hw/audio/es1370.c:#define a(n) if (val & SCTRL_##n) strcat (buf, " "#n)
> hw/audio/es1370.c:#define b(n) if (!(val & SCTRL_##n)) strcat (buf, " "#n)
>
> Maybe writing it without the space between "# is clearer as then it
> looks more like it's part of the value.
I think keeping the space is better.
The reason is that CTRL_##n pastes together CTRL_ and n, but " "#n is
different:
1) First, it turns n into a string, for example "1"
2) Then, just because there is another string just before, the two are
concatenated, as in "CTRL_" "1".
Paolo
|