kernel: thread: add default case, remove unused break
According to the Zephyr Coding Guideline all switch statements shall be well-formed. Add a default case with break and comment to avoid static analysis tool to raise a violation that there is no default case. Also, I think, in all cases above no need to use "break", because they already are using "return". Found as a coding guideline violation (MISRA R16.1) by static coding scanning tool. Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This commit is contained in:
parent
3960d413db
commit
e9600a75fc
1 changed files with 4 additions and 7 deletions
|
@ -267,27 +267,24 @@ const char *k_thread_state_str(k_tid_t thread_id)
|
|||
switch (thread_id->base.thread_state) {
|
||||
case 0:
|
||||
return "";
|
||||
break;
|
||||
case _THREAD_DUMMY:
|
||||
return "dummy";
|
||||
break;
|
||||
case _THREAD_PENDING:
|
||||
return "pending";
|
||||
break;
|
||||
case _THREAD_PRESTART:
|
||||
return "prestart";
|
||||
break;
|
||||
case _THREAD_DEAD:
|
||||
return "dead";
|
||||
break;
|
||||
case _THREAD_SUSPENDED:
|
||||
return "suspended";
|
||||
break;
|
||||
case _THREAD_ABORTING:
|
||||
return "aborting";
|
||||
break;
|
||||
case _THREAD_QUEUED:
|
||||
return "queued";
|
||||
default:
|
||||
/* Add a break, some day when another case gets added at the end,
|
||||
* this bit of defensive programming will be useful
|
||||
*/
|
||||
break;
|
||||
}
|
||||
return "unknown";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue