xen/arm: Make use of DT_MATCH_TIMER in make_timer_node
PATCH 1/1 xen/arm: Make use of DT_MATCH_TIMER in make_timer_node
DT_MATCH_TIMER stores the compatible timer ids and as such should be used in all the places where we need to refer to them. make_timer_node explicitly lists the same ids as the ones defined in DT_MATCH_TIMER so make use of this macro instead.
--- xen/arch/arm/domain_build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/arm/domain_build.c +1 -2
@@ -1672,8 +1672,7 @@ static int __init make_timer_node(const struct kernel_info *kinfo)void *fdt = kinfo->fdt;static const struct dt_device_match timer_ids[]__initconst = { -DT_MATCH_COMPATIBLE ("arm,armv7-timer" ), -DT_MATCH_COMPATIBLE ("arm,armv8-timer" ), +DT_MATCH_TIMER , {/* sentinel */ }, };struct dt_device_node *dev;
Signature · 1 line
2.25.1
Quoted 6 lines · Michal Orzel
DT_MATCH_TIMERstores the compatible timer ids and as such should be used in all the places where we need to refer to them.make_timer_nodeexplicitly lists the same ids as the ones defined inDT_MATCH_TIMERso make use of this macro instead.Signed-off-by Michal Orzel <[email protected]>
This is a good cleanup, thanks! time.h is not currently included by domain_build.c, I think we should add:
#include <asm/time.h>
to domain_build.c
Quoted 21 lines
--- xen/arch/arm/domain_build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)xen/arch/arm/domain_build.c +1
-2@@ -1672,8 +1672,7 @@ static int __init make_timer_node(const struct kernel_info *kinfo)void *fdt = kinfo->fdt;static const struct dt_device_match timer_ids[]__initconst = { -DT_MATCH_COMPATIBLE ("arm,armv7-timer" ), -DT_MATCH_COMPATIBLE ("arm,armv8-timer" ), +DT_MATCH_TIMER , {/* sentinel */ }, };struct dt_device_node *dev;Signature · 1 line
2.25.1
Hi Stefano,
Quoted 6 lines · Stefano Stabellini
Quoted 5 lines · Michal Orzel
DT_MATCH_TIMERstores the compatible timer ids and as such should be used in all the places where we need to refer to them.make_timer_nodeexplicitly lists the same ids as the ones defined inDT_MATCH_TIMERso make use of this macro instead.
Quoted 9 lines
Quoted 1 line
Signed-off-by Michal Orzel <[email protected]>This is a good cleanup, thanks!
time.his not currently included bydomain_build.c, I think we should add:#include <
asm/time.h>to
domain_build.c
asm/time.h is included by xen/time.h which is included by xen/irq.h. That is why there is no build failure and the patch itself is correct.
Furthermore DT_MATCH_TIMER is already used in domain_build.c (handle_node) together with other constructs like TIMER_PHYS_SECURE_PPI defined in asm/time.h.
Cheers,
Michal
Stefano Stabellini
Reviewed-byQuoted 16 lines · Michal Orzel
Hi Stefano,
Quoted 13 lines · Stefano Stabellini
Quoted 6 lines · Michal Orzel
DT_MATCH_TIMERstores the compatible timer ids and as such should be used in all the places where we need to refer to them.make_timer_nodeexplicitly lists the same ids as the ones defined inDT_MATCH_TIMERso make use of this macro instead.Signed-off-by Michal Orzel <[email protected]>This is a good cleanup, thanks!
time.his not currently included bydomain_build.c, I think we should add:#include <
asm/time.h>
Quoted 7 lines
Quoted 2 lines
to
domain_build.c
asm/time.his included byxen/time.hwhich is included byxen/irq.h. That is why there is no build failure and the patch itself is correct.Furthermore
DT_MATCH_TIMERis already used indomain_build.c(handle_node) together with other constructs likeTIMER_PHYS_SECURE_PPIdefined inasm/time.h.
OK, fair point. We should disentangle the headers at some point but given that this patch is not making anything worse:
and committed