Hi Ido,

> From: Ido Yariv [mailto:i...@wizery.com]
> > +struct resource_table *rproc_elf_get_rsctab_addr(struct rproc *rproc,
> > +                                            const struct firmware *fw)
> > +{
> > +   struct elf32_shdr *shdr;
> > +
> > +   shdr = find_rsc_shdr(&rproc->dev, (struct elf32_hdr *)fw->data);
> > +   if (!shdr)
> > +           return NULL;
> 
> Instead of traversing the headers twice, perhaps we could save the
> address and size in advance and use it here?

To do that we would have to store the struct elf32_shdr in struct rproc.
So this is a trade-off between bloating rproc structure with shdr or 
spending some more cpu-cycles to scan the elf sections.
It shouldn't be that many sections to scan, and as we've just parsed
this firmware sections earlier so it might be hot in cache.
This shouldn't be very expensive, so I'd prefer to keep this as is.

Are you OK with that?

Regards,
Sjur
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to