aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/setup.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/include/asm/setup.h')
-rw-r--r--arch/riscv/include/asm/setup.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/riscv/include/asm/setup.h b/arch/riscv/include/asm/setup.h
index 731b0d96aaa..4b182432f1e 100644
--- a/arch/riscv/include/asm/setup.h
+++ b/arch/riscv/include/asm/setup.h
@@ -145,14 +145,18 @@ struct tagtable {
int (*parse)(const struct tag *);
};
-#define tag_member_present(tag, member) \
+#define tag_member_present(_tag, member) \
+ typeof(_tag) (tag) = (_tag); \
((unsigned long)(&((struct tag *)0L)->member + 1) \
<= (tag)->hdr.size * 4)
-#define tag_next(t) ((struct tag *)((u32 *)(t) + (t)->hdr.size))
+#define tag_next(_t) \
+ typeof(_t) (t) = (_t); \
+ ((struct tag *)((u32 *)(t) + (t)->hdr.size))
#define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2)
-#define for_each_tag(t, base) \
+#define for_each_tag(_t, base) \
+ typeof(_t) (t) = (_t); \
for (t = base; t->hdr.size; t = tag_next(t))
#ifdef __KERNEL__