kernel: rename shadow variables
Renames shadow variables found by -Wshadow. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
6b740b20de
commit
9c0ff33e04
3 changed files with 28 additions and 28 deletions
|
@ -2450,9 +2450,9 @@ struct k_fifo {
|
|||
#define k_fifo_alloc_put(fifo, data) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_fifo, alloc_put, fifo, data); \
|
||||
int ret = k_queue_alloc_append(&(fifo)->_queue, data); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, alloc_put, fifo, data, ret); \
|
||||
ret; \
|
||||
int fap_ret = k_queue_alloc_append(&(fifo)->_queue, data); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, alloc_put, fifo, data, fap_ret); \
|
||||
fap_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -2516,9 +2516,9 @@ struct k_fifo {
|
|||
#define k_fifo_get(fifo, timeout) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_fifo, get, fifo, timeout); \
|
||||
void *ret = k_queue_get(&(fifo)->_queue, timeout); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, get, fifo, timeout, ret); \
|
||||
ret; \
|
||||
void *fg_ret = k_queue_get(&(fifo)->_queue, timeout); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, get, fifo, timeout, fg_ret); \
|
||||
fg_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -2553,9 +2553,9 @@ struct k_fifo {
|
|||
#define k_fifo_peek_head(fifo) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_fifo, peek_head, fifo); \
|
||||
void *ret = k_queue_peek_head(&(fifo)->_queue); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, peek_head, fifo, ret); \
|
||||
ret; \
|
||||
void *fph_ret = k_queue_peek_head(&(fifo)->_queue); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, peek_head, fifo, fph_ret); \
|
||||
fph_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -2572,9 +2572,9 @@ struct k_fifo {
|
|||
#define k_fifo_peek_tail(fifo) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_fifo, peek_tail, fifo); \
|
||||
void *ret = k_queue_peek_tail(&(fifo)->_queue); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, peek_tail, fifo, ret); \
|
||||
ret; \
|
||||
void *fpt_ret = k_queue_peek_tail(&(fifo)->_queue); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, peek_tail, fifo, fpt_ret); \
|
||||
fpt_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -2667,9 +2667,9 @@ struct k_lifo {
|
|||
#define k_lifo_alloc_put(lifo, data) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_lifo, alloc_put, lifo, data); \
|
||||
int ret = k_queue_alloc_prepend(&(lifo)->_queue, data); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_lifo, alloc_put, lifo, data, ret); \
|
||||
ret; \
|
||||
int lap_ret = k_queue_alloc_prepend(&(lifo)->_queue, data); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_lifo, alloc_put, lifo, data, lap_ret); \
|
||||
lap_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -2692,9 +2692,9 @@ struct k_lifo {
|
|||
#define k_lifo_get(lifo, timeout) \
|
||||
({ \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_lifo, get, lifo, timeout); \
|
||||
void *ret = k_queue_get(&(lifo)->_queue, timeout); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_lifo, get, lifo, timeout, ret); \
|
||||
ret; \
|
||||
void *lg_ret = k_queue_get(&(lifo)->_queue, timeout); \
|
||||
SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_lifo, get, lifo, timeout, lg_ret); \
|
||||
lg_ret; \
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
|
@ -493,11 +493,11 @@ void k_sched_time_slice_set(int32_t slice, int prio)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_TIMESLICE_PER_THREAD
|
||||
void k_thread_time_slice_set(struct k_thread *th, int32_t slice_ticks,
|
||||
void k_thread_time_slice_set(struct k_thread *th, int32_t thread_slice_ticks,
|
||||
k_thread_timeslice_fn_t expired, void *data)
|
||||
{
|
||||
K_SPINLOCK(&sched_spinlock) {
|
||||
th->base.slice_ticks = slice_ticks;
|
||||
th->base.slice_ticks = thread_slice_ticks;
|
||||
th->base.slice_expired = expired;
|
||||
th->base.slice_data = data;
|
||||
}
|
||||
|
|
16
kernel/smp.c
16
kernel/smp.c
|
@ -9,7 +9,7 @@
|
|||
#include <kernel_internal.h>
|
||||
|
||||
static atomic_t global_lock;
|
||||
static atomic_t start_flag;
|
||||
static atomic_t cpu_start_flag;
|
||||
static atomic_t ready_flag;
|
||||
|
||||
unsigned int z_smp_global_lock(void)
|
||||
|
@ -56,10 +56,10 @@ static inline void local_delay(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void wait_for_start_signal(atomic_t *cpu_start_flag)
|
||||
static void wait_for_start_signal(atomic_t *start_flag)
|
||||
{
|
||||
/* Wait for the signal to begin scheduling */
|
||||
while (!atomic_get(cpu_start_flag)) {
|
||||
while (!atomic_get(start_flag)) {
|
||||
local_delay();
|
||||
}
|
||||
}
|
||||
|
@ -107,20 +107,20 @@ static void start_cpu(int id, atomic_t *start_flag)
|
|||
|
||||
void z_smp_start_cpu(int id)
|
||||
{
|
||||
(void)atomic_set(&start_flag, 1); /* async, don't care */
|
||||
start_cpu(id, &start_flag);
|
||||
(void)atomic_set(&cpu_start_flag, 1); /* async, don't care */
|
||||
start_cpu(id, &cpu_start_flag);
|
||||
}
|
||||
|
||||
void z_smp_init(void)
|
||||
{
|
||||
(void)atomic_clear(&start_flag);
|
||||
(void)atomic_clear(&cpu_start_flag);
|
||||
|
||||
unsigned int num_cpus = arch_num_cpus();
|
||||
|
||||
for (int i = 1; i < num_cpus; i++) {
|
||||
start_cpu(i, &start_flag);
|
||||
start_cpu(i, &cpu_start_flag);
|
||||
}
|
||||
(void)atomic_set(&start_flag, 1);
|
||||
(void)atomic_set(&cpu_start_flag, 1);
|
||||
}
|
||||
|
||||
bool z_smp_cpu_mobile(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue