kernel: Checkpatch fixups

I was pretty careful, but these snuck in.  Most of them are due to
overbroad string replacements in comments.  The pull request is very
large, and I'm too lazy to find exactly where to back-merge all of
these.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-09-29 07:34:55 -07:00 committed by Anas Nashif
commit cfe62038d2
10 changed files with 43 additions and 31 deletions

View file

@ -216,7 +216,7 @@ void _timer_int_handler(void *unused)
z_clock_announce(_sys_idle_elapsed_ticks); z_clock_announce(_sys_idle_elapsed_ticks);
/* z_clock_announce(_sys_idle_elapsed_ticks) could cause new programming */ /* z_clock_announce() could cause new programming */
if (!programmed_ticks && _sys_clock_always_on) { if (!programmed_ticks && _sys_clock_always_on) {
z_tick_set(z_clock_uptime()); z_tick_set(z_clock_uptime());
program_max_cycles(); program_max_cycles();

View file

@ -270,7 +270,7 @@ void _timer_int_handler(void *unused)
z_clock_announce(_sys_idle_elapsed_ticks); z_clock_announce(_sys_idle_elapsed_ticks);
/* z_clock_announce(_sys_idle_elapsed_ticks) could cause new programming */ /* z_clock_announce() could cause new programming */
if (!idle_original_ticks && _sys_clock_always_on) { if (!idle_original_ticks && _sys_clock_always_on) {
z_tick_set(z_clock_uptime()); z_tick_set(z_clock_uptime());
/* clear overflow tracking flag as it is accounted */ /* clear overflow tracking flag as it is accounted */
@ -754,15 +754,16 @@ return (u32_t) get_elapsed_count();
do { do {
cac = clock_accumulated_count; cac = clock_accumulated_count;
#ifdef CONFIG_TICKLESS_IDLE #ifdef CONFIG_TICKLESS_IDLE
/* When we leave a tickless period the reload value of the timer /* When we leave a tickless period the reload value of
* can be set to a remaining value to wait until end of tick. * the timer can be set to a remaining value to wait
* (see z_clock_idle_exit). The remaining value is always smaller * until end of tick. (see z_clock_idle_exit). The
* than default_load_value. In this case the time elapsed until * remaining value is always smaller than
* the timer restart was not yet added to * default_load_value. In this case the time elapsed
* clock_accumulated_count. To retrieve a correct cycle count * until the timer restart was not yet added to
* we must therefore consider the number of cycle since current * clock_accumulated_count. To retrieve a correct
* tick period start and not only the cycle number since * cycle count we must therefore consider the number
* the timer restart. * of cycle since current tick period start and not
* only the cycle number since the timer restart.
*/ */
if (SysTick->LOAD < default_load_value) { if (SysTick->LOAD < default_load_value) {
count = default_load_value; count = default_load_value;

View file

@ -301,7 +301,7 @@ void _timer_int_handler(void *unused)
programmed_ticks = 0; programmed_ticks = 0;
z_clock_announce(_sys_idle_elapsed_ticks); z_clock_announce(_sys_idle_elapsed_ticks);
/* z_clock_announce(_sys_idle_elapsed_ticks) could cause new programming */ /* z_clock_announce() could cause new programming */
if (!programmed_ticks && _sys_clock_always_on) { if (!programmed_ticks && _sys_clock_always_on) {
z_tick_set(z_clock_uptime()); z_tick_set(z_clock_uptime());
program_max_cycles(); program_max_cycles();

View file

@ -320,7 +320,7 @@ void _timer_int_handler(void *unused /* parameter is not used */
z_clock_announce(_sys_idle_elapsed_ticks); z_clock_announce(_sys_idle_elapsed_ticks);
/* z_clock_announce(_sys_idle_elapsed_ticks) could cause new programming */ /* z_clock_announce() could cause new programming */
if (!programmed_full_ticks && _sys_clock_always_on) { if (!programmed_full_ticks && _sys_clock_always_on) {
z_tick_set(z_clock_uptime()); z_tick_set(z_clock_uptime());
program_max_cycles(); program_max_cycles();
@ -332,16 +332,20 @@ void _timer_int_handler(void *unused /* parameter is not used */
u32_t cycles; u32_t cycles;
/* /*
* The timer fired unexpectedly. This is due to one of two cases: * The timer fired unexpectedly. This is due
* to one of two cases:
* 1. Entering tickless idle straddled a tick. * 1. Entering tickless idle straddled a tick.
* 2. Leaving tickless idle straddled the final tick. * 2. Leaving tickless idle straddled the final tick.
* Due to the timer reprogramming in z_clock_idle_exit(), case #2 * Due to the timer reprogramming in
* can be handled as a fall-through. * z_clock_idle_exit(), case #2 can be handled
* as a fall-through.
* *
* NOTE: Although the cycle count is supposed to stop decrementing * NOTE: Although the cycle count is supposed
* once it hits zero in one-shot mode, not all targets implement * to stop decrementing once it hits zero in
* this properly (and continue to decrement). Thus, we have to * one-shot mode, not all targets implement
* perform a second comparison to check for wrap-around. * this properly (and continue to decrement).
* Thus, we have to perform a second
* comparison to check for wrap-around.
*/ */
cycles = current_count_register_get(); cycles = current_count_register_get();
@ -604,7 +608,7 @@ void z_clock_idle_exit(void)
* *
* NOTE #1: In the case of a straddled tick, the '_sys_idle_elapsed_ticks' * NOTE #1: In the case of a straddled tick, the '_sys_idle_elapsed_ticks'
* calculation below may result in either 0 or 1. If 1, then this may * calculation below may result in either 0 or 1. If 1, then this may
* result in a harmless extra call to z_clock_announce(_sys_idle_elapsed_ticks). * result in a harmless extra call to z_clock_announce().
* *
* NOTE #2: In the case of a straddled tick, it is assumed that when the * NOTE #2: In the case of a straddled tick, it is assumed that when the
* timer is reprogrammed, it will be reprogrammed with a cycle count * timer is reprogrammed, it will be reprogrammed with a cycle count

View file

@ -209,7 +209,8 @@ void _timer_idle_enter(s32_t sys_ticks)
/* If ticks is 0, the RTC interrupt handler will be set pending /* If ticks is 0, the RTC interrupt handler will be set pending
* immediately, meaning that we will not go to sleep. * immediately, meaning that we will not go to sleep.
*/ */
rtc_compare_set(rtc_past + (sys_ticks * sys_clock_hw_cycles_per_tick())); rtc_compare_set(rtc_past +
(sys_ticks * sys_clock_hw_cycles_per_tick()));
#endif #endif
} }
@ -435,7 +436,7 @@ void z_clock_idle_exit(void)
rtc_announce_set_next(); rtc_announce_set_next();
/* After exiting idle, the kernel no longer expects more than one sys /* After exiting idle, the kernel no longer expects more than one sys
* ticks to have passed when z_clock_announce(_sys_idle_elapsed_ticks) is called. * ticks to have passed when z_clock_announce() is called.
*/ */
expected_sys_ticks = 1; expected_sys_ticks = 1;
#endif #endif
@ -493,7 +494,7 @@ void rtc1_nrf5_isr(void *arg)
/* Anounce elapsed of _sys_idle_elapsed_ticks systicks*/ /* Anounce elapsed of _sys_idle_elapsed_ticks systicks*/
z_clock_announce(_sys_idle_elapsed_ticks); z_clock_announce(_sys_idle_elapsed_ticks);
/* z_clock_announce(_sys_idle_elapsed_ticks) could cause new programming */ /* z_clock_announce() could cause new programming */
if (!expected_sys_ticks && _sys_clock_always_on) { if (!expected_sys_ticks && _sys_clock_always_on) {
program_max_cycles(); program_max_cycles();
} }
@ -530,7 +531,8 @@ int z_clock_driver_init(struct device *device)
/* TODO: replace with counter driver to access RTC */ /* TODO: replace with counter driver to access RTC */
SYS_CLOCK_RTC->PRESCALER = 0; SYS_CLOCK_RTC->PRESCALER = 0;
nrf_rtc_cc_set(SYS_CLOCK_RTC, RTC_CC_IDX, sys_clock_hw_cycles_per_tick()); nrf_rtc_cc_set(SYS_CLOCK_RTC, RTC_CC_IDX,
sys_clock_hw_cycles_per_tick());
nrf_rtc_event_enable(SYS_CLOCK_RTC, RTC_EVTENSET_COMPARE0_Msk); nrf_rtc_event_enable(SYS_CLOCK_RTC, RTC_EVTENSET_COMPARE0_Msk);
nrf_rtc_int_enable(SYS_CLOCK_RTC, RTC_INTENSET_COMPARE0_Msk); nrf_rtc_int_enable(SYS_CLOCK_RTC, RTC_INTENSET_COMPARE0_Msk);

View file

@ -1218,6 +1218,10 @@ __syscall void k_thread_name_set(k_tid_t thread_id, const char *value);
*/ */
__syscall const char *k_thread_name_get(k_tid_t thread_id); __syscall const char *k_thread_name_get(k_tid_t thread_id);
/**
* @}
*/
/** /**
* @addtogroup clock_apis * @addtogroup clock_apis
* @{ * @{

View file

@ -124,7 +124,8 @@ void test_clock_cycle(void)
if (c1 > c0) { if (c1 > c0) {
/* delta cycle should be greater than 1 milli-second*/ /* delta cycle should be greater than 1 milli-second*/
zassert_true((c1 - c0) > zassert_true((c1 - c0) >
(sys_clock_hw_cycles_per_sec() / MSEC_PER_SEC), NULL); (sys_clock_hw_cycles_per_sec() / MSEC_PER_SEC),
NULL);
/* delta NS should be greater than 1 milli-second */ /* delta NS should be greater than 1 milli-second */
zassert_true(SYS_CLOCK_HW_CYCLES_TO_NS(c1 - c0) > zassert_true(SYS_CLOCK_HW_CYCLES_TO_NS(c1 - c0) >
(NSEC_PER_SEC / MSEC_PER_SEC), NULL); (NSEC_PER_SEC / MSEC_PER_SEC), NULL);