cortex-m: warnings: Address -Wextra warnings
`#defines` do NOT sepecify a type. They will either adopt a native system type or type of the value that was passed into the expression. This can lead to warnings such as, "warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]". By casting expressions, such as `MAX_TICKS` to `k_ticks_t`, we can force the appropriate types and resolve these warnings. Signed-off-by: Zachary J. Fields <zachary_fields@yahoo.com>
This commit is contained in:
parent
cb0ce21480
commit
c29dcb3a98
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define CYC_PER_TICK (sys_clock_hw_cycles_per_sec() \
|
||||
/ CONFIG_SYS_CLOCK_TICKS_PER_SEC)
|
||||
#define MAX_TICKS ((COUNTER_MAX / CYC_PER_TICK) - 1)
|
||||
#define MAX_TICKS ((k_ticks_t)(COUNTER_MAX / CYC_PER_TICK) - 1)
|
||||
#define MAX_CYCLES (MAX_TICKS * CYC_PER_TICK)
|
||||
|
||||
/* Minimum cycles in the future to try to program. Note that this is
|
||||
|
@ -27,7 +27,7 @@
|
|||
* masked. Choosing a fraction of a tick is probably a good enough
|
||||
* default, with an absolute minimum of 1k cyc.
|
||||
*/
|
||||
#define MIN_DELAY MAX(1024, (CYC_PER_TICK/16))
|
||||
#define MIN_DELAY MAX(1024U, ((uint32_t)CYC_PER_TICK/16U))
|
||||
|
||||
#define TICKLESS (IS_ENABLED(CONFIG_TICKLESS_KERNEL))
|
||||
|
||||
|
|
Loading…
Reference in a new issue