logging: Simplify function to get number of log backends

As we subtracting pointers of the same type, it is not necessary cast
it to u8_t. This simplify and avoid some MISRA-C violations, e.g rule
11.8.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-12-04 12:15:28 -08:00 committed by Andrew Boie
commit aabd8e7fa0

View file

@ -171,8 +171,7 @@ static inline const struct log_backend *log_backend_get(u32_t idx)
*/
static inline int log_backend_count_get(void)
{
return ((u8_t *)__log_backends_end - (u8_t *)__log_backends_start) /
sizeof(struct log_backend);
return __log_backends_end - __log_backends_start;
}
/**