lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 18 Sep 2012 07:23:31 +0300
From:	Ohad Ben-Cohen <ohad@...ery.com>
To:	sjur.brandeland@...ricsson.com
Cc:	Sjur Brændeland <sjurbren@...il.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2] remoteproc: Export notification id range

Hi Sjur,

On Thu, Sep 13, 2012 at 9:03 PM,  <sjur.brandeland@...ricsson.com> wrote:
> From: Sjur Brændeland <sjur.brandeland@...ricsson.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@...ricsson.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ