[kernel] remove the register keyword (#5888)

This commit is contained in:
Man, Jianting (Meco) 2022-04-28 18:34:42 -04:00 committed by GitHub
parent c28b79b7d7
commit 6295ec108e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 35 deletions

View File

@ -75,7 +75,7 @@ int __wqueue_default_wake(struct rt_wqueue_node *wait, void *key)
void rt_wqueue_wakeup(rt_wqueue_t *queue, void *key)
{
rt_base_t level;
register int need_schedule = 0;
int need_schedule = 0;
rt_list_t *queue_list;
struct rt_list_node *node;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -172,7 +172,7 @@ static int set_timeval(struct timeval *tv)
struct tm *gmtime_r(const time_t *timep, struct tm *r)
{
time_t i;
register time_t work = *timep % (SPD);
time_t work = *timep % (SPD);
r->tm_sec = work % 60;
work /= 60;
r->tm_min = work % 60;
@ -181,7 +181,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *r)
r->tm_wday = (4 + work) % 7;
for (i = 1970;; ++i)
{
register time_t k = __isleap(i) ? 366 : 365;
time_t k = __isleap(i) ? 366 : 365;
if (work >= k)
work -= k;
else
@ -367,9 +367,9 @@ RTM_EXPORT(stime);
time_t timegm(struct tm * const t)
{
register time_t day;
register time_t i;
register time_t years = (time_t)t->tm_year - 70;
time_t day;
time_t i;
time_t years = (time_t)t->tm_year - 70;
if (t->tm_sec > 60) /* seconds after the minute - [0, 60] including leap second */
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -344,9 +344,9 @@ void rt_thread_idle_init(void)
rt_thread_t rt_thread_idle_gethandler(void)
{
#ifdef RT_USING_SMP
register int id = rt_hw_cpu_id();
int id = rt_hw_cpu_id();
#else
register int id = 0;
int id = 0;
#endif /* RT_USING_SMP */
return (rt_thread_t)(&idle[id]);

View File

@ -606,7 +606,7 @@ RTM_EXPORT(rt_sem_trytake);
rt_err_t rt_sem_release(rt_sem_t sem)
{
rt_base_t level;
register rt_bool_t need_schedule;
rt_bool_t need_schedule;
/* parameter check */
RT_ASSERT(sem != RT_NULL);
@ -1442,7 +1442,7 @@ rt_err_t rt_event_send(rt_event_t event, rt_uint32_t set)
struct rt_list_node *n;
struct rt_thread *thread;
rt_base_t level;
register rt_base_t status;
rt_base_t status;
rt_bool_t need_schedule;
/* parameter check */
@ -1570,7 +1570,7 @@ rt_err_t rt_event_recv(rt_event_t event,
{
struct rt_thread *thread;
rt_base_t level;
register rt_base_t status;
rt_base_t status;
/* parameter check */
RT_ASSERT(event != RT_NULL);
@ -2491,7 +2491,7 @@ rt_err_t rt_mq_init(rt_mq_t mq,
rt_uint8_t flag)
{
struct rt_mq_message *head;
register rt_base_t temp;
rt_base_t temp;
/* parameter check */
RT_ASSERT(mq != RT_NULL);
@ -2615,7 +2615,7 @@ rt_mq_t rt_mq_create(const char *name,
{
struct rt_messagequeue *mq;
struct rt_mq_message *head;
register rt_base_t temp;
rt_base_t temp;
RT_ASSERT((flag == RT_IPC_FLAG_FIFO) || (flag == RT_IPC_FLAG_PRIO));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -495,7 +495,7 @@ RTM_EXPORT(rt_strcpy);
*/
rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count)
{
register signed char __res = 0;
signed char __res = 0;
while (count)
{
@ -668,7 +668,7 @@ rt_inline int divide(long *n, int base)
rt_inline int skip_atoi(const char **s)
{
register int i = 0;
int i = 0;
while (_ISDIGIT(**s))
i = i * 10 + *((*s)++) - '0';
@ -707,8 +707,7 @@ static char *print_number(char *buf,
const char *digits;
static const char small_digits[] = "0123456789abcdef";
static const char large_digits[] = "0123456789ABCDEF";
register int i;
register int size;
int i, size;
size = s;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@ -93,7 +93,7 @@ rt_err_t rt_mp_init(struct rt_mempool *mp,
rt_size_t block_size)
{
rt_uint8_t *block_ptr;
register rt_size_t offset;
rt_size_t offset;
/* parameter check */
RT_ASSERT(mp != RT_NULL);
@ -201,7 +201,7 @@ rt_mp_t rt_mp_create(const char *name,
{
rt_uint8_t *block_ptr;
struct rt_mempool *mp;
register rt_size_t offset;
rt_size_t offset;
RT_DEBUG_NOT_IN_INTERRUPT;

View File

@ -132,11 +132,11 @@ static void _rt_scheduler_stack_check(struct rt_thread *thread)
#ifdef RT_USING_SMP
static struct rt_thread* _scheduler_get_highest_priority_thread(rt_ubase_t *highest_prio)
{
register struct rt_thread *highest_priority_thread;
register rt_ubase_t highest_ready_priority, local_highest_ready_priority;
struct rt_thread *highest_priority_thread;
rt_ubase_t highest_ready_priority, local_highest_ready_priority;
struct rt_cpu* pcpu = rt_cpu_self();
#if RT_THREAD_PRIORITY_MAX > 32
register rt_ubase_t number;
rt_ubase_t number;
number = __rt_ffs(rt_thread_ready_priority_group) - 1;
highest_ready_priority = (number << 3) + __rt_ffs(rt_thread_ready_table[number]) - 1;
@ -168,11 +168,11 @@ static struct rt_thread* _scheduler_get_highest_priority_thread(rt_ubase_t *high
#else
static struct rt_thread* _scheduler_get_highest_priority_thread(rt_ubase_t *highest_prio)
{
register struct rt_thread *highest_priority_thread;
register rt_ubase_t highest_ready_priority;
struct rt_thread *highest_priority_thread;
rt_ubase_t highest_ready_priority;
#if RT_THREAD_PRIORITY_MAX > 32
register rt_ubase_t number;
rt_ubase_t number;
number = __rt_ffs(rt_thread_ready_priority_group) - 1;
highest_ready_priority = (number << 3) + __rt_ffs(rt_thread_ready_table[number]) - 1;
@ -199,7 +199,7 @@ void rt_system_scheduler_init(void)
#ifdef RT_USING_SMP
int cpu;
#endif /* RT_USING_SMP */
register rt_base_t offset;
rt_base_t offset;
#ifndef RT_USING_SMP
rt_scheduler_lock_nest = 0;
@ -247,7 +247,7 @@ void rt_system_scheduler_init(void)
*/
void rt_system_scheduler_start(void)
{
register struct rt_thread *to_thread;
struct rt_thread *to_thread;
rt_ubase_t highest_ready_priority;
to_thread = _scheduler_get_highest_priority_thread(&highest_ready_priority);
@ -870,7 +870,7 @@ void rt_enter_critical(void)
*/
{
register rt_uint16_t lock_nest = current_thread->cpus_lock_nest;
rt_uint16_t lock_nest = current_thread->cpus_lock_nest;
current_thread->cpus_lock_nest++;
if (lock_nest == 0)
{

View File

@ -327,7 +327,7 @@ RTM_EXPORT(rt_thread_init);
rt_thread_t rt_thread_self(void)
{
#ifdef RT_USING_SMP
register rt_base_t lock;
rt_base_t lock;
rt_thread_t self;
lock = rt_hw_local_irq_disable();
@ -836,7 +836,7 @@ RTM_EXPORT(rt_thread_control);
*/
rt_err_t rt_thread_suspend(rt_thread_t thread)
{
register rt_base_t stat;
rt_base_t stat;
rt_base_t level;
/* parameter check */

View File

@ -409,7 +409,7 @@ rt_err_t rt_timer_start(rt_timer_t timer)
unsigned int row_lvl;
rt_list_t *timer_list;
rt_base_t level;
register rt_bool_t need_schedule;
rt_bool_t need_schedule;
rt_list_t *row_head[RT_TIMER_SKIP_LIST_LEVEL];
unsigned int tst_nr;
static unsigned int random_nr;