dma40: remove unnecessary ALIGN()s
authorRabin Vincent <rabin.vincent@stericsson.com>
Tue, 25 Jan 2011 10:18:12 +0000 (11:18 +0100)
committerDan Williams <dan.j.williams@intel.com>
Mon, 31 Jan 2011 06:27:17 +0000 (22:27 -0800)
ALIGN(x * y, y) == x * y
ALIGN(aligned + x * y, y) == aligned + x * y

Acked-by: Per Forlin <per.forlin@stericsson.com>
Acked-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/dma/ste_dma40.c

index ce55162..d32a9ac 100644 (file)
@@ -344,7 +344,7 @@ static int d40_pool_lli_alloc(struct d40_desc *d40d,
                d40d->lli_pool.size = sizeof(d40d->lli_pool.pre_alloc_lli);
                d40d->lli_pool.base = NULL;
        } else {
-               d40d->lli_pool.size = ALIGN(lli_len * 2 * align, align);
+               d40d->lli_pool.size = lli_len * 2 * align;
 
                base = kmalloc(d40d->lli_pool.size + align, GFP_NOWAIT);
                d40d->lli_pool.base = base;
@@ -356,13 +356,11 @@ static int d40_pool_lli_alloc(struct d40_desc *d40d,
        if (is_log) {
                d40d->lli_log.src = PTR_ALIGN((struct d40_log_lli *) base,
                                              align);
-               d40d->lli_log.dst = PTR_ALIGN(d40d->lli_log.src + lli_len,
-                                             align);
+               d40d->lli_log.dst = d40d->lli_log.src + lli_len;
        } else {
                d40d->lli_phy.src = PTR_ALIGN((struct d40_phy_lli *)base,
                                              align);
-               d40d->lli_phy.dst = PTR_ALIGN(d40d->lli_phy.src + lli_len,
-                                             align);
+               d40d->lli_phy.dst = d40d->lli_phy.src + lli_len;
        }
 
        return 0;