[PATCH 2/2] pch_dma: Modify redundant memory allocation

From: Tomoya MORINAGA
Date: Tue Oct 11 2011 - 08:43:46 EST


nr_channels is defined in "struct pch_dma".
and struct pch_dma_chan is defined in "struct pch_dma".
So, "sizeof(struct pch_dma_chan) * nr_channels" is unnecessary.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@xxxxxxxxxxxxxxxxxx>
---
drivers/dma/pch_dma.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index e72bfeb..d78f526 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -811,8 +811,7 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev,
int i;

nr_channels = id->driver_data;
- pd = kzalloc(sizeof(struct pch_dma)+
- sizeof(struct pch_dma_chan) * nr_channels, GFP_KERNEL);
+ pd = kzalloc(sizeof(struct pch_dma), GFP_KERNEL);
if (!pd)
return -ENOMEM;

--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/