zephyr/include/logging
Torstein Grindvik 84cdc6fd92 logging: Refactoring macro to avoid Coverity issue
Change a runtime log check such that Coverity does not report a
needless issue on every use of any log macro.

Before the change, this was used in log macros:

    else if(is_user_context || (_level <= LOG_RUNTIME_FILTER(_filter)))

If runtime filtering is not enabled, this expands to:

    else if(is_user_context || 1)

Because the level is compared to log level debug (4) and will always be,
equal or lower.
Coverity always reports this as a potential issue, since the
variable part (is_user_context) makes no difference.

After the change, a macro is used which expands into the original code
when runtime filtering is used, else it simply expands to:

    else if(true)

Which has equal semantics as the previous code but isn't flagged by
Coverity.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2020-10-04 14:45:45 -07:00
..
log_backend.h logging: Fixed compile warning with extern array declaration 2020-06-09 14:42:16 +02:00
log_core.h logging: Refactoring macro to avoid Coverity issue 2020-10-04 14:45:45 -07:00
log_ctrl.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
log_frontend.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
log_instance.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
log_msg.h code-guideline: Fixing code violation 10.4 Rule 2020-10-01 17:13:29 -04:00
log_output.h zephyr: replace zephyr integer types with C99 types 2020-06-08 08:23:57 -05:00
log.h sys: util: Deprecate GET_ARG2 macro 2020-06-22 15:18:07 +02:00