[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 13/13] ARM: XEN: Move xen_early_init() before efi_init()




On 2015/11/21 1:30, Stefano Stabellini wrote:
>> +struct xen_node_info {
>> > +  const char *compat;
>> > +  const char *prefix;
>> > +  const char *version;
>> > +  bool found;
>> > +};
>> > +
>> > +static int __init fdt_find_xen_node(unsigned long node, const char *uname,
>> > +                              int depth, void *data)
>> > +{
>> > +  struct xen_node_info *info = data;
>> > +  const void *s = NULL;
>> > +  int len;
>> > +
>> > +  if (depth != 1 || strcmp(uname, "hypervisor") != 0)
>> > +          return 0;
>> > +
>> > +  if (of_flat_dt_is_compatible(node, info->compat))
>> > +          info->found = true;
>> > +
>> > +  s = of_get_flat_dt_prop(node, "compatible", &len);
>> > +  if (strlen(info->prefix) + 3  < len &&
>> > +                        !strncmp(info->prefix, s, strlen(info->prefix)))
>> > +                info->version = s + strlen(info->prefix);
>> > +  return 0;
>> > +}
>> > +
>> >  /*
>> >   * see Documentation/devicetree/bindings/arm/xen.txt for the
>> >   * documentation of the Xen Device Tree format.
>> > @@ -149,26 +176,25 @@ static irqreturn_t xen_arm_callback(int irq, void 
>> > *arg)
>> >  #define GRANT_TABLE_PHYSADDR 0
>> >  void __init xen_early_init(void)
>> >  {
>> > -  int len;
>> > -  const char *s = NULL;
>> > -  const char *version = NULL;
>> > -  const char *xen_prefix = "xen,xen-";
>> > +  struct xen_node_info info;
>> > +
>> > +  info.compat = "xen,xen";
>> > +  info.prefix = "xen,xen-";
>> > +  info.version = NULL;
>> > +  info.found = false;
> Can you initialize the fields directly when you define xen_node_info and
> make it static?
Sure.

Thanks,
-- 
Shannon


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.