[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 24/26] hw/usb/usb-hcd: Use UHCI type definitions
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 24/26] hw/usb/usb-hcd: Use UHCI type definitions |
Date: |
Sun, 5 Jul 2020 07:37:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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
- Re: [PATCH 22/26] hw/usb/usb-hcd: Use OHCI type definitions, (continued)
[PATCH 25/26] hw/usb/usb-hcd: Use XHCI type definitions, Philippe Mathieu-Daudé, 2020/07/04
[PATCH 26/26] MAINTAINERS: Cover dwc-hsotg (dwc2) USB host controller emulation, Philippe Mathieu-Daudé, 2020/07/04
Re: [PATCH 00/26] hw/usb: Give it love, reduce 'hw/usb.h' inclusion out of hw/usb/, Gerd Hoffmann, 2020/07/13