summaryrefslogtreecommitdiff
path: root/arch/riscv/include/asm/setup.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-03-30 18:16:56 -0400
committerTom Rini <trini@konsulko.com>2018-03-30 18:16:56 -0400
commit0ca0a546b186478b9de80cbd27fa8baf17e30863 (patch)
treeda9e58e3cab0a924755bb9be2e809cd18468fc8c /arch/riscv/include/asm/setup.h
parent2476d26fd307edc84e8257dc1bccefb65547f88a (diff)
parentd58717e42559189a226ea800173147399c8edef9 (diff)
Merge git://git.denx.de/u-boot-riscv
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 731b0d96aa..4b182432f1 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__