qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 17/17] hw/mips: Convert Malta "ifdef 0"-ed code to comment


From: Markus Armbruster
Subject: Re: [PATCH v2 17/17] hw/mips: Convert Malta "ifdef 0"-ed code to comments
Date: Fri, 15 May 2020 09:53:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Aleksandar Markovic <address@hidden> writes:

> The checkpatch complain about "#ifdef 0". Convert corresponding
> dead code to comments. In future, these cases could be converted
> to some no-nonsense logging/tracing.
>
> Signed-off-by: Aleksandar Markovic <address@hidden>
> CC: Philippe Mathieu-Daudé <address@hidden>
> ---
>  hw/mips/mips_malta.c | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index e4c4de1b4e..f91fa34b06 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -427,10 +427,12 @@ static uint64_t malta_fpga_read(void *opaque, hwaddr 
> addr,
>          break;
>  
>      default:
> -#if 0
> -        printf("malta_fpga_read: Bad register offset 0x" TARGET_FMT_lx "\n",
> -               addr);
> -#endif
> +/*
> + * Possible logging:
> + *
> + *        printf("malta_fpga_read: Bad register offset 0x" TARGET_FMT_lx 
> "\n",
> + *               addr);
> + */
>          break;
>      }
>      return val;
> @@ -515,10 +517,12 @@ static void malta_fpga_write(void *opaque, hwaddr addr,
>          break;
>  
>      default:
> -#if 0
> -        printf("malta_fpga_write: Bad register offset 0x" TARGET_FMT_lx "\n",
> -               addr);
> -#endif
> +/*
> + * Possible logging:
> + *
> + *        printf("malta_fpga_write: Bad register offset 0x" TARGET_FMT_lx 
> "\n",
> + *               addr);
> + */
>          break;
>      }
>  }

Please don't.

Checkpatch warns "if this code is redundant consider removing it\n".

If it is redundant, do remove it.

If it is not redundant, do ignore checkpatch's warning, do not abuse
comments to hide from checkpatch.  We'd rather not have to code up a
warning for that :)

These two look like they want to be tracepoints.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]