aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-01-07 20:50:16 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-01-07 20:50:16 +0200
commitacc26f85f32c68a51e5cc7b613cd0ea0b0630505 (patch)
tree90d68a8292360f0796509f1febc7b66b0a53f4aa /include
parent8d90fb3e4a5d02df75584016563ef84901967b9f (diff)
downloadkmi-acc26f85f32c68a51e5cc7b613cd0ea0b0630505.tar.gz
kmi-acc26f85f32c68a51e5cc7b613cd0ea0b0630505.zip
Use #if defined(...) when not guard clause
Diffstat (limited to 'include')
-rw-r--r--include/apos/debug.h6
-rw-r--r--include/apos/initrd.h8
-rw-r--r--include/apos/types.h2
-rw-r--r--include/arch/vmem.h4
-rw-r--r--include/libfdt.h6
5 files changed, 13 insertions, 13 deletions
diff --git a/include/apos/debug.h b/include/apos/debug.h
index a9e5d46..ec591ef 100644
--- a/include/apos/debug.h
+++ b/include/apos/debug.h
@@ -5,7 +5,7 @@
#include <apos/pmem.h>
#include <arch/vmem.h>
-#ifdef DEBUG
+#if defined(DEBUG)
enum serial_dev {
/* only the NS16550A and compatible at the moment */
NS16550A,
@@ -13,13 +13,13 @@ enum serial_dev {
void __fmt(1, 2) dbg(const char *fmt, ...);
-void init_dbg(void *fdt);
+void init_dbg(const void *fdt);
void setup_dmap_dbg();
void setup_io_dbg(struct vm_branch *b);
void setup_dbg(pm_t pt, enum serial_dev dev);
-struct dbg_info dbg_from_fdt(void *fdt);
+struct dbg_info dbg_from_fdt(const void *fdt);
#define COMMON_FORMAT "[%s] %s:%d\n\t"
#define COMMON_ARGS(s) s, __FILE__, __LINE__
diff --git a/include/apos/initrd.h b/include/apos/initrd.h
index 4b28ba8..17ed94c 100644
--- a/include/apos/initrd.h
+++ b/include/apos/initrd.h
@@ -5,10 +5,10 @@
#include <apos/pmem.h>
#include <apos/vmem.h>
-size_t get_init_size(void *fdt);
-vm_t get_init_base(void *fdt);
+size_t get_init_size(const void *fdt);
+vm_t get_init_base(const void *fdt);
-pm_t get_initrdtop(void *fdt);
-pm_t get_initrdbase(void *fdt);
+pm_t get_initrdtop(const void *fdt);
+pm_t get_initrdbase(const void *fdt);
#endif /* APOS_INITRD_H */
diff --git a/include/apos/types.h b/include/apos/types.h
index 2d9bef1..9b90611 100644
--- a/include/apos/types.h
+++ b/include/apos/types.h
@@ -58,7 +58,7 @@ typedef intmax_t ssize_t;
#define SCHAR_MIN (-__SCHAR_MAX - 1)
#define UCHAR_MAX (2 * __SCHAR_MAX__ - 1)
-#ifdef __CHAR_UNSIGNED__
+#if defined(__CHAR_UNSIGNED__)
#define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX
#else
diff --git a/include/arch/vmem.h b/include/arch/vmem.h
index 17fa13d..ddb0e54 100644
--- a/include/arch/vmem.h
+++ b/include/arch/vmem.h
@@ -18,8 +18,8 @@ void flush_tlb_all();
void populate_root_branch(struct vm_branch *b);
struct vm_branch *init_vmem(void *fdt);
-#ifdef DEBUG
-stat_t setup_kernel_io(struct vm_branch *b, vm_t paddr);
+#if defined(DEBUG)
+vm_t setup_kernel_io(struct vm_branch *b, vm_t paddr);
#endif
#endif /* APOS_ARCH_PAGES_H */
diff --git a/include/libfdt.h b/include/libfdt.h
index 304abb7..602cdcb 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -9,11 +9,11 @@ struct cell_info {
uint32_t addr_cells;
};
-struct cell_info get_cellinfo(void *fdt, int offset);
-struct cell_info get_reginfo(void *fdt, const char *path);
+struct cell_info get_cellinfo(const void *fdt, const int offset);
+struct cell_info get_reginfo(const void *fdt, const char *path);
#if defined(DEBUG)
-void __dbg_fdt(void *fdt, int node_offset, int depth);
+void __dbg_fdt(const void *fdt, int node_offset, int depth);
#define dbg_fdt(fdt) __dbg_fdt(fdt, 0, 0)
#else
#define dbg_fdt(...)