From b096078c282af7233062ba242a213e6f5574cfb1 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 23 May 2022 20:40:53 +0300 Subject: switch from clang-format to uncrustify The output is close enough, and I like that uncrustify is a third-party tool, so people can install a single tool for formatting instead of having to lug around a whole toolchain. I fully expect to have to add settings to uncrustify.conf, but let's see how this goes. --- include/apos/mem.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/apos/mem.h') diff --git a/include/apos/mem.h b/include/apos/mem.h index bbe7532..7d24e0e 100644 --- a/include/apos/mem.h +++ b/include/apos/mem.h @@ -13,14 +13,16 @@ #define pnum_to_index(pnum, order) \ (((pnum) >> __o_offset(order)) & (__o_width(order) - 1)) -#define pm_to_index(paddr, order) (pnum_to_index(pm_to_pnum(paddr), (order))) +#define pm_to_index(paddr, \ + order) (pnum_to_index(pm_to_pnum(paddr), (order))) #define pm_to_pnum(paddr) ((paddr) >> __mm_page_shift) #define pnum_to_paddr(pnum) ((pnum) << __mm_page_shift) #define move_forward(var, num) (((var) += (num)) - (num)) #define move_paddr(paddr, base, offset) ((((pm_t)(paddr)) - (base)) + (offset)) -#define num_elems(num) (((num) + MM_OINFO_WIDTH - 1) / MM_OINFO_WIDTH) +#define num_elems(num) (((num) + MM_OINFO_WIDTH - 1) / \ + MM_OINFO_WIDTH) #define num_indexes(num) ((num) / MM_OINFO_WIDTH) #define index_elems(num) ((num) / MM_OINFO_WIDTH) #define state_elems(num) (sizeof(mm_info_t) * (num_elems(num))) @@ -35,13 +37,15 @@ #define __o_container(idx) ((idx) / MM_OINFO_WIDTH) #define __o_bit(idx) ((idx) & (MM_OINFO_WIDTH - 1)) -#define __va(x) (void *)(((uintptr_t)(x)) + VM_DMAP - RAM_BASE) -#define __pa(x) (void *)(((uintptr_t)(x)) - VM_DMAP + RAM_BASE) +#define __va(x) (void *)(((uintptr_t)(x)) + VM_DMAP - \ + RAM_BASE) +#define __pa(x) (void *)(((uintptr_t)(x)) - VM_DMAP + \ + RAM_BASE) #define __page(x) ((x) / BASE_PAGE_SIZE) #define __addr(x) ((x)*BASE_PAGE_SIZE) #define __pages(x) \ (is_aligned((x), BASE_PAGE_SIZE) ? __page((x)) : \ - __page((x) + BASE_PAGE_SIZE)) + __page((x) + BASE_PAGE_SIZE)) #define __bytes(x) (__addr(x)) /* if memory region is used or not */ -- cgit v1.3