misra: Fixes for MISRA-C rule 8.3
MISRA-C says all declarations of an object or function must use the
same name and qualifiers.
MISRA-C rule 8.3
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
diff --git a/kernel/sched.c b/kernel/sched.c
index 2373046..7389e63 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -80,7 +80,7 @@
#ifdef CONFIG_SMP
return thread->base.is_idle;
#else
- extern struct k_thread * const _idle_thread;
+ extern k_tid_t const _idle_thread;
return thread == _idle_thread;
#endif
@@ -229,11 +229,11 @@
z_set_timeout_expiry(slice_time, false);
}
-void k_sched_time_slice_set(s32_t duration_in_ms, int prio)
+void k_sched_time_slice_set(s32_t slice, int prio)
{
LOCKED(&sched_lock) {
_current_cpu->slice_ticks = 0;
- slice_time = _ms_to_ticks(duration_in_ms);
+ slice_time = _ms_to_ticks(slice);
slice_max_prio = prio;
reset_time_slice();
}
@@ -669,12 +669,12 @@
return CONTAINER_OF(n, struct k_thread, base.qnode_dlist);
}
-int _unpend_all(_wait_q_t *waitq)
+int _unpend_all(_wait_q_t *wait_q)
{
int need_sched = 0;
struct k_thread *th;
- while ((th = _waitq_head(waitq)) != NULL) {
+ while ((th = _waitq_head(wait_q)) != NULL) {
_unpend_thread(th);
_ready_thread(th);
need_sched = 1;
diff --git a/kernel/timeout.c b/kernel/timeout.c
index b9a1158..adafe27 100644
--- a/kernel/timeout.c
+++ b/kernel/timeout.c
@@ -105,18 +105,18 @@
return ret;
}
-s32_t z_timeout_remaining(struct _timeout *to)
+s32_t z_timeout_remaining(struct _timeout *timeout)
{
s32_t ticks = 0;
- if (to->dticks == _INACTIVE) {
+ if (timeout->dticks == _INACTIVE) {
return 0;
}
LOCKED(&timeout_lock) {
for (struct _timeout *t = first(); t != NULL; t = next(t)) {
ticks += t->dticks;
- if (to == t) {
+ if (timeout == t) {
break;
}
}
diff --git a/kernel/timer.c b/kernel/timer.c
index 78d4332..b3d6b8a 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -93,8 +93,8 @@
void k_timer_init(struct k_timer *timer,
- void (*expiry_fn)(struct k_timer *t),
- void (*stop_fn)(struct k_timer *t))
+ k_timer_expiry_t expiry_fn,
+ k_timer_stop_t stop_fn)
{
timer->expiry_fn = expiry_fn;
timer->stop_fn = stop_fn;
diff --git a/kernel/userspace.c b/kernel/userspace.c
index 7b16855..b8b60d4 100644
--- a/kernel/userspace.c
+++ b/kernel/userspace.c
@@ -547,7 +547,7 @@
return 0;
}
-void _k_object_init(void *object)
+void _k_object_init(void *obj)
{
struct _k_object *ko;
@@ -559,7 +559,7 @@
* finalizes it
*/
- ko = _k_object_find(object);
+ ko = _k_object_find(obj);
if (ko == NULL) {
/* Supervisor threads can ignore rules about kernel objects
* and may declare them on stacks, etc. Such objects will never
@@ -572,9 +572,9 @@
ko->flags |= K_OBJ_FLAG_INITIALIZED;
}
-void _k_object_recycle(void *object)
+void _k_object_recycle(void *obj)
{
- struct _k_object *ko = _k_object_find(object);
+ struct _k_object *ko = _k_object_find(obj);
if (ko != NULL) {
(void)memset(ko->perms, 0, sizeof(ko->perms));
@@ -583,12 +583,12 @@
}
}
-void _k_object_uninit(void *object)
+void _k_object_uninit(void *obj)
{
struct _k_object *ko;
/* See comments in _k_object_init() */
- ko = _k_object_find(object);
+ ko = _k_object_find(obj);
if (ko == NULL) {
return;
}