Messages in this thread |  | | From | Ohad Ben-Cohen <> | Date | Tue, 18 Sep 2012 07:23:31 +0300 | Subject | Re: [PATCHv2] remoteproc: Export notification id range |
| |
Hi Sjur,
On Thu, Sep 13, 2012 at 9:03 PM, <sjur.brandeland@stericsson.com> wrote: > From: Sjur Brændeland <sjur.brandeland@stericsson.com> > > Some of the rproc drivers needs to know the range > of the notification IDs used for notifying the device. > Export a variable in struct rproc holding the > largest allocated notification id. > > Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com> > --- ... > void rproc_free_vring(struct rproc_vring *rvring) > { > + int i, maxid = 0; > + struct rproc_vdev *rvdev, *tmp; > int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); > struct rproc *rproc = rvring->rvdev->rproc; > > dma_free_coherent(rproc->dev.parent, size, rvring->va, rvring->dma); > idr_remove(&rproc->notifyids, rvring->notifyid); > + > + /* Iterate over the new set of rings to find the largest id */ > + rvring->notifyid = 0; > + list_for_each_entry_safe(rvdev, tmp, &rproc->rvdevs, node)
Why do you need the safe variant here ?
> + for (i = 0; i < RVDEV_NUM_VRINGS; i++)
Maybe instead of two nested loops, just use idr_for_each ?
Thanks, Ohad. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |