diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/nodes.c | 5 | ||||
| -rw-r--r-- | common/tcb.c | 2 | ||||
| -rw-r--r-- | common/timer.c | 10 | ||||
| -rw-r--r-- | common/uapi/conf.c | 8 |
4 files changed, 12 insertions, 13 deletions
diff --git a/common/nodes.c b/common/nodes.c index 6ff42b1..0c6f7ce 100644 --- a/common/nodes.c +++ b/common/nodes.c @@ -13,7 +13,7 @@ * being free) */ -#define node_region(r)\ +#define node_region(r) \ ((struct node_region *)((uintptr_t)(r) & ~(BASE_PAGE_SIZE - 1))) static struct node_region *__create_region() @@ -144,7 +144,8 @@ void free_node(struct node_root *r, void *p) { struct node_region *nr = node_region(p); uint8_t *bitmap = r->bitmap + (uint8_t *)nr; - size_t i = ((uintptr_t)p - (r->first_node + (uintptr_t)nr)) / r->node_size; + size_t i = + ((uintptr_t)p - (r->first_node + (uintptr_t)nr)) / r->node_size; bitmap_clear(bitmap, i); if (--nr->used_nodes == 0) { diff --git a/common/tcb.c b/common/tcb.c index 4a69df6..5d6b8a2 100644 --- a/common/tcb.c +++ b/common/tcb.c @@ -15,7 +15,7 @@ static struct tcb **tcbs; /* if we ever support systems with massive amounts of cpus, this should probably * be allocated at runtime */ -static struct tcb *cpu_tcb[MAX_CPUS] = {0}; +static struct tcb *cpu_tcb[MAX_CPUS] = { 0 }; void init_tcbs() { diff --git a/common/timer.c b/common/timer.c index f35c983..2006a6c 100644 --- a/common/timer.c +++ b/common/timer.c @@ -7,7 +7,7 @@ #include <arch/cpu.h> static ticks_t ticks_per_sec = 0; -static struct sp_root cpu_timers[MAX_CPUS] = {0}; +static struct sp_root cpu_timers[MAX_CPUS] = { 0 }; static struct node_root node_root; struct timer_node { @@ -15,11 +15,9 @@ struct timer_node { struct timer timer; }; -#define timer_container(ptr)\ - container_of(ptr, struct timer_node, sp_n) +#define timer_container(ptr) container_of(ptr, struct timer_node, sp_n) -#define timer_node_container(ptr)\ - container_of(ptr, struct timer_node, timer) +#define timer_node_container(ptr) container_of(ptr, struct timer_node, timer) static struct sp_root *__cpu_timers() { @@ -61,7 +59,7 @@ static id_t __insert_timer(struct timer_node *ti) d = RIGHT; } } - + if (sp_root(root)) sp_insert(&sp_root(root), p, &ti->sp_n, d); else diff --git a/common/uapi/conf.c b/common/uapi/conf.c index 3002fc2..3fe6481 100644 --- a/common/uapi/conf.c +++ b/common/uapi/conf.c @@ -17,10 +17,10 @@ SYSCALL_DEFINE2(conf)(vm_t param, vm_t val) SYSCALL_DEFINE1(poweroff)(vm_t type) { switch (type) { - case SHUTDOWN: - case COLD_REBOOT: - case WARM_REBOOT: - return poweroff(type); + case SHUTDOWN: + case COLD_REBOOT: + case WARM_REBOOT: + return poweroff(type); }; return ERR_INVAL; |
