diff options
author | Eric Blake <eblake@redhat.com> | 2017-12-01 17:24:33 -0600 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-16 14:54:52 +0100 |
commit | f4bdc13e492208f4f9cad0ff1c14247dea1cd197 (patch) | |
tree | 2a30c7062a0516e974c3b720d1123473cdd27731 /trace-events | |
parent | 2562755ee78983930d0662fa4d3bc5e2ac166350 (diff) |
checkpatch: Enforce proper do/while (0) style
Use of a loop construct for code that is not intended to repeat
does not make much idiomatic sense, except in one place: it is a
common usage in macros in order to wrap arbitrary code with
single-statement semantics. But when used in a macro, it is more
typical for the caller to supply the trailing ';' when calling
the macro.
Although qemu coding style frowns on bare:
if (cond)
statement1;
else
statement2;
where extra semicolons actually cause syntax errors, we still
want our macro styles to be easily copied to other projects.
Thus, declare it an error if we encounter any form of 'while (0)'
with a semicolon in the same line.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20171201232433.25193-8-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'trace-events')
0 files changed, 0 insertions, 0 deletions