summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2020-08-24 21:56:26 -0700
committerShuah Khan <skhan@linuxfoundation.org>2020-10-02 10:36:36 -0600
commitaa803771a80aa2aa2d5cdd38434b369066fbb8fc (patch)
tree06a3f5167f6ea23d3d3a01a0be73dddd7c8cbbc7 /tools/lib
parentc8bd596f9388bceda6cf008d554cbb1a4f2244e7 (diff)
downloadlinux-aa803771a80aa2aa2d5cdd38434b369066fbb8fc.tar.bz2
tools: Avoid comma separated statements
Use semicolons and braces. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/subcmd/help.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
index 2859f107abc8..bf02d62a3b2b 100644
--- a/tools/lib/subcmd/help.c
+++ b/tools/lib/subcmd/help.c
@@ -65,12 +65,14 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes)
ci = cj = ei = 0;
while (ci < cmds->cnt && ei < excludes->cnt) {
cmp = strcmp(cmds->names[ci]->name, excludes->names[ei]->name);
- if (cmp < 0)
+ if (cmp < 0) {
cmds->names[cj++] = cmds->names[ci++];
- else if (cmp == 0)
- ci++, ei++;
- else if (cmp > 0)
+ } else if (cmp == 0) {
+ ci++;
ei++;
+ } else if (cmp > 0) {
+ ei++;
+ }
}
while (ci < cmds->cnt)