diff options
author | Julia Lawall <julia@diku.dk> | 2009-12-13 06:40:39 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-01-12 12:19:31 -0500 |
commit | 42ecda1ae80b4b19c3c7ba36e3141c4c19e1fe70 (patch) | |
tree | 4fafa20ecea17a6bf05675d963d4f078e2ddeab4 /arch/mips/alchemy | |
parent | 05c694681e059b9e99449bb239367ab486cd1fca (diff) |
MIPS: Alchemy: Correct code taking the size of a pointer
sizeof(dp) is just the size of the pointer. Change it to the size of the
referenced structure.
A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression *x;
expression f;
type T;
@@
*f(...,(T)x,...)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Patchwork: http://patchwork.linux-mips.org/patch/789/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/alchemy')
-rw-r--r-- | arch/mips/alchemy/common/dbdma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c index 19c1c82849ff..5c68569344c1 100644 --- a/arch/mips/alchemy/common/dbdma.c +++ b/arch/mips/alchemy/common/dbdma.c | |||
@@ -613,7 +613,7 @@ u32 _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags) | |||
613 | dma_cache_wback_inv((unsigned long)buf, nbytes); | 613 | dma_cache_wback_inv((unsigned long)buf, nbytes); |
614 | dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ | 614 | dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ |
615 | au_sync(); | 615 | au_sync(); |
616 | dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); | 616 | dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); |
617 | ctp->chan_ptr->ddma_dbell = 0; | 617 | ctp->chan_ptr->ddma_dbell = 0; |
618 | 618 | ||
619 | /* Get next descriptor pointer. */ | 619 | /* Get next descriptor pointer. */ |
@@ -676,7 +676,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags) | |||
676 | dma_cache_inv((unsigned long)buf, nbytes); | 676 | dma_cache_inv((unsigned long)buf, nbytes); |
677 | dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ | 677 | dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ |
678 | au_sync(); | 678 | au_sync(); |
679 | dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); | 679 | dma_cache_wback_inv((unsigned long)dp, sizeof(*dp)); |
680 | ctp->chan_ptr->ddma_dbell = 0; | 680 | ctp->chan_ptr->ddma_dbell = 0; |
681 | 681 | ||
682 | /* Get next descriptor pointer. */ | 682 | /* Get next descriptor pointer. */ |