qemu-patch-raspberry4/scripts
Max Reitz a97ceca578 checkpatch: Brace handling on multi-line condition
CODING_STYLE states the following about braces around blocks:

> The opening brace is on the line that contains the control flow
> statement that introduces the new block; [...]

This is obviously impossible with multi-line conditions. Therefore,
CODING_STYLE does not make any clear statement about where to put the
opening brace after a multi-line condition.

There is a reason to prefer to place the opening brace on an own line
after such a condition while still placing it on the same line as the
"control flow statement" if possible; that reason is that the last line
of a multi-line condition is indented, in the case of "if", it is often
indented by four spaces, just as much as the first statement in the
block will be indented. This is hard to read as there is no clearly
visible distinction between condition and block. Placing the opening
brace on a separate line solves this issue.

Also, there are cases where placing the opening brace on a separate line
is the only viable option; if the previous line had nearly 80 characters
and splitting it is not desirable, the opening brace is naturally placed
on an own line.

This patch fixes checkpatch.pl to not complain about braces on own lines
if the condition introducing the block spanned more than one line, or if
the previous line had 79 or 80 characters.

Furthermore, the warning about not having braces around a block is fixed
to mind braces not being on the last line of the condition.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-01-13 11:47:56 +00:00
..
kvm kvm_stat: Add powerpc support 2014-10-31 16:36:23 +01:00
qemu-guest-agent
qmp
tracetool Tracing: Fix simpletrace.py error on tcg enabled binary traces 2014-11-18 14:05:58 +00:00
acpi_extract.py i386: Add an ACPI_EXTRACT_NAME_BUFFER16 directive. 2014-11-02 11:52:24 +02:00
acpi_extract_preprocess.py
analyse-9p-simpletrace.py
check-qerror.sh
checkpatch.pl checkpatch: Brace handling on multi-line condition 2015-01-13 11:47:56 +00:00
cleanup-trace-events.pl cleanup-trace-events.pl: Tighten search for trace event call 2014-09-26 09:34:38 +01:00
coverity-model.c
create_config
disas-objdump.pl
dump-guest-memory.py
extract-vsssdk-headers
feature_to_c.sh
get_maintainer.pl get_maintainer.pl: Remove the --git-chief-penguins option 2014-12-10 11:46:43 +03:00
gtester-cat
hxtool
make-release
make_device_config.sh
ordereddict.py
qapi-commands.py
qapi-event.py
qapi-types.py qapi: Allow enums in anonymous unions 2014-09-22 11:39:33 +01:00
qapi-visit.py qapi: add visit_start_union and visit_end_union 2014-09-26 13:14:10 -04:00
qapi.py qapi.py: avoid Python 2.5+ any() function 2014-08-28 13:42:25 +01:00
qemu-binfmt-conf.sh
qemu-gdb.py
refresh-pxe-roms.sh
signrom.py
simpletrace.py
switch-timer-api
texi2pod.pl
tracetool.py
update-acpi.sh
update-linux-headers.sh
vmstate-static-checker.py