From 9eab89ff204051dcab1660aa65abb187c89f0f77 Mon Sep 17 00:00:00 2001 From: Maksim Masalski Date: Tue, 18 May 2021 16:03:21 +0800 Subject: [PATCH] lib: replace one case switch with if operator Current "switch" operator with one case replace with the "if" operator, because every switch statement shall have at least two case-clauses. Found as a coding guideline violation (MISRA R16.1) by static coding scanning tool. Signed-off-by: Maksim Masalski --- lib/os/fdtable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/os/fdtable.c b/lib/os/fdtable.c index 3b737e77b32b5c..e1272179e12dbb 100644 --- a/lib/os/fdtable.c +++ b/lib/os/fdtable.c @@ -304,8 +304,7 @@ int fcntl(int fd, int cmd, ...) } /* Handle fdtable commands. */ - switch (cmd) { - case F_DUPFD: + if (cmd == F_DUPFD) { /* Not implemented so far. */ errno = EINVAL; return -1;