[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 06/10] hw/sd: Add sd_cmd_unimplemented() handler
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC PATCH 06/10] hw/sd: Add sd_cmd_unimplemented() handler |
Date: |
Fri, 25 Jun 2021 19:17:04 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 6/25/21 3:49 PM, Bin Meng wrote:
> On Thu, Jun 24, 2021 at 10:28 PM Philippe Mathieu-Daudé <f4bug@amsat.org>
> wrote:
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> hw/sd/sd.c | 21 ++++++++++++---------
>> 1 file changed, 12 insertions(+), 9 deletions(-)
>> qemu_log_mask(LOG_GUEST_ERROR, "SD: ACMD%i in a wrong state\n",
>> req.cmd);
>> @@ -2096,6 +2096,9 @@ static const SDProto sd_proto_spi = {
>> [26] = sd_cmd_illegal,
>> [52 ... 54] = sd_cmd_illegal,
>> },
>> + .cmd = {
>> + [6] = sd_cmd_unimplemented,
>> + },
>> };
>
> Does this compile?
Yes.
> Or is this another GCC extension to C?
I haven't checked when this was introduced, but QEMU uses it since
quite some time now.
Apparently this is:
https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
"In ISO C99 you can give the elements in any order, specifying
the array indices or structure field names they apply to, and
GNU C allows this as an extension in C90 mode as well."
> But I think you wanted to say .acmd = ?
Oops!
Thanks for the review,
Phil.
- Re: [RFC PATCH 03/10] hw/sd: Move proto_name to SDProto structure, (continued)
[RFC PATCH 07/10] hw/sd: Add sd_cmd_GO_IDLE_STATE() handler, Philippe Mathieu-Daudé, 2021/06/24
[RFC PATCH 08/10] hw/sd: Add sd_cmd_SEND_OP_CMD() handler, Philippe Mathieu-Daudé, 2021/06/24
[RFC PATCH 09/10] hw/sd: Add sd_cmd_ALL_SEND_CID() handler, Philippe Mathieu-Daudé, 2021/06/24
[RFC PATCH 10/10] hw/sd: Add sd_cmd_SEND_RELATIVE_ADDR() handler, Philippe Mathieu-Daudé, 2021/06/24
Re: [RFC PATCH 00/10] hw/sd: Start splitting SD vs SPI protocols, Cédric Le Goater, 2021/06/28