lkml.org 
[lkml]   [2012]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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/

\
 
 \ /
  Last update: 2012-09-18 06:41    [W:0.067 / U:2.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site