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:
parent
f4e07f494a
commit
aabd8e7fa0
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue