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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 25 Mar 2010 17:55:11 -0700
From:	Dan Williams <dan.j.williams@...el.com>
To:	Richard Röjfors <richard.rojfors@...agicore.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH 1/2] dma: Add timb-dma

On Thu, Mar 25, 2010 at 11:44 AM, Richard Röjfors
<richard.rojfors@...agicore.com> wrote:
> Adds the support for the DMA engine withing the timberdale FPGA.
>
> The DMA channels are strict device to host, or host to device
> and can not be used for generic memcpy.
>
> Signed-off-by: Richard Röjfors <richard.rojfors@...agicore.com>
[..]
> +struct timb_dma_chan {
> +       struct dma_chan         chan;
> +       void __iomem            *membase;
> +       spinlock_t              lock; /* Used for mutual exclusion */

Please add some value to this comment.  I can assume it protects all
list manipulations, anything non-obvious worth noting?

[..]
> +
> +static int td_fill_desc(struct timb_dma_chan *td_chan, u8 *dma_desc,
> +       struct scatterlist *sg, bool last)
> +{
> +       if (sg_dma_len(sg) > USHORT_MAX) {
> +               dev_err(chan2dev(&td_chan->chan), "Too big sg element\n");
> +               return -EINVAL;
> +       }
> +
> +       /* length must be word aligned */
> +       if (sg_dma_len(sg) % sizeof(u32)) {
> +               dev_err(chan2dev(&td_chan->chan), "Incorrect length: %d\n",
> +                       sg_dma_len(sg));
> +               return -EINVAL;
> +       }
> +
> +       dev_dbg(chan2dev(&td_chan->chan), "desc: %p, addr: %p\n",
> +               dma_desc, (void *)(int)sg_dma_address(sg));

That (int) cast is not needed, causes a compiler warning, and can be dropped.

Nice simple driver.  You can just send a follow up patch to fix up
those minor issues.  I've pushed it out to my 'next' branch [1].

--
Dan

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx.git next
--
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