coding guidelines rule 14_3_j: add explicit case check

Violation of the [MISRAC2012-RULE_14_3-j]:
Boolean operations whose results are invariant
shall not be permitted

Probably in that part of code is a misprint.
Added to check _OBJ_INIT_FALSE case explicitly

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This commit is contained in:
Maksim Masalski 2021-05-17 16:58:20 +08:00 committed by Anas Nashif
commit 929956df70

View file

@ -669,7 +669,7 @@ int z_object_validate(struct z_object *ko, enum k_objects otype,
if (unlikely((ko->flags & K_OBJ_FLAG_INITIALIZED) == 0U)) { if (unlikely((ko->flags & K_OBJ_FLAG_INITIALIZED) == 0U)) {
return -EINVAL; return -EINVAL;
} }
} else if (init < _OBJ_INIT_TRUE) { /* _OBJ_INIT_FALSE case */ } else if (init == _OBJ_INIT_FALSE) { /* _OBJ_INIT_FALSE case */
/* Object MUST NOT be initialized */ /* Object MUST NOT be initialized */
if (unlikely((ko->flags & K_OBJ_FLAG_INITIALIZED) != 0U)) { if (unlikely((ko->flags & K_OBJ_FLAG_INITIALIZED) != 0U)) {
return -EADDRINUSE; return -EADDRINUSE;