On 02/24/2018 06:56 AM, 苏航 wrote:
Hi, when I try to change
`while (cond) ;`
to
`while (cond) {
}`
checkpatch.pl complains about this:
'''
ERROR: suspect code indent for conditional statements (8, 8)
#1506: FILE: uri.c:1506:
+ while ((*tmp++ = *segp++) != 0) {
[...]
+ }
ERROR: suspect code indent for conditional statements (8, 8)
#1512: FILE: uri.c:1512:
+ while ((segp > path) && ((--segp)[0] == '/')) {
[...]
+ }
'''
When I add a semicolon, checkpatch.pl stop complaining.
`while (cond) {
;
}`
What should I do now?
Keeping a semicolon is one option, another is a well-placed comment:
while (cond) {
/* No further work */
}
And in general, we try to avoid top-posting on this list.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org