Skip to content

Commit

Permalink
lib: replace one case switch with if operator
Browse files Browse the repository at this point in the history
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 <maksim.masalski@intel.com>
  • Loading branch information
maksimmasalski authored and galak committed Jun 4, 2021
1 parent a61edd4 commit 9eab89f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/os/fdtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9eab89f

Please sign in to comment.