[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword
From: |
John Snow |
Subject: |
Re: [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 18:27:25 -0400 |
On Fri, Oct 13, 2023 at 3:50 AM Emmanouil Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:
>
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/ide/atapi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
> index dcc39df9a4..85c74a5ffe 100644
> --- a/hw/ide/atapi.c
> +++ b/hw/ide/atapi.c
> @@ -1189,53 +1189,54 @@ static void cmd_read_disc_information(IDEState *s,
> uint8_t* buf)
> static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf)
> {
> int max_len;
> int media = buf[1];
> int format = buf[7];
> int ret;
>
> max_len = lduw_be_p(buf + 8);
>
> if (format < 0xff) {
> if (media_is_cd(s)) {
> ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
> ASC_INCOMPATIBLE_FORMAT);
> return;
> } else if (!media_present(s)) {
> ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
> ASC_INV_FIELD_IN_CMD_PACKET);
> return;
> }
> }
>
> memset(buf, 0, max_len > IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 ?
> IDE_DMA_BUF_SECTORS * BDRV_SECTOR_SIZE + 4 : max_len);
>
> switch (format) {
> case 0x00 ... 0x7f:
> case 0xff:
> if (media == 0) {
> ret = ide_dvd_read_structure(s, format, buf, buf);
>
> if (ret < 0) {
> ide_atapi_cmd_error(s, ILLEGAL_REQUEST, -ret);
> } else {
> ide_atapi_cmd_reply(s, ret, max_len);
> }
>
> break;
> }
> /* TODO: BD support, fall through for now */
> + fallthrough;
ACK. For a moment I was wondering if this was something new to gcc,
but I guess it's just a macro you made O:-)
Acked-by: John Snow <jsnow@redhat.com>
>
> /* Generic disk structures */
> case 0x80: /* TODO: AACS volume identifier */
> case 0x81: /* TODO: AACS media serial number */
> case 0x82: /* TODO: AACS media identifier */
> case 0x83: /* TODO: AACS media key block */
> case 0x90: /* TODO: List of recognized format layers */
> case 0xc0: /* TODO: Write protection status */
> default:
> ide_atapi_cmd_error(s, ILLEGAL_REQUEST,
> ASC_INV_FIELD_IN_CMD_PACKET);
> break;
> }
> }
> --
> 2.39.2
>
- Re: [RFC PATCH 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough, (continued)
- [RFC PATCH 02/78] block: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 04/78] qapi/opts-visitor: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 05/78] qobject/json: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 03/78] fpu/softfloat: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 07/78] hw/virtio/virtio-balloon.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 08/78] hw/block: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 06/78] tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- Re: [RFC PATCH 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword,
John Snow <=
- [RFC PATCH 11/78] hw/timer: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 12/78] hw/usb: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 13/78] hw/adc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 14/78] util/error-report.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 15/78] accel/tcg: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 17/78] ui/sdl2.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 16/78] audio: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 19/78] target/hppa: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13