qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/4] checkpatch: adapt some tests to QEMU


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 3/4] checkpatch: adapt some tests to QEMU
Date: Thu, 17 Sep 2015 15:24:46 +0100

On 7 September 2015 at 10:53, Paolo Bonzini <address@hidden> wrote:
> Mostly change severity levels, but some tests can also be adjusted to refer
> to QEMU APIs or data structures.
>
> Signed-off-by: Paolo Bonzini <address@hidden>

> @@ -1956,9 +1941,14 @@ sub process {
>                         ERROR("open brace '{' following $1 go on the same 
> line\n" . $hereprev);
>                 }
>
> +# ... however, open braces on typedef lines should be avoided.
> +               if ($line =~ 
> /^.\s*typedef\s+(enum|union|struct)(?:\s+$Ident\b)?.*[^;]$/) {
> +                       ERROR("typedefs should be separate from struct 
> declaration\n" . $herecurr);
> +               }
> +
>  # missing space after union, struct or enum definition

Can we revert this one, please? Checkpatch now warns about constructs
like
  typedef struct MyDevice {
      DeviceState parent;

      int reg0, reg1, reg2;
  } MyDevice;

which I think are common practice throughout QEMU (recommended
as part of the examples in include/qom/object.h and
in http://wiki.qemu.org/QOMConventions, for instance).

$ git grep 'typedef struct.*{' |wc -l
1884

thanks
-- PMM



reply via email to

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