Przeglądaj źródła

pch_dma: Reduce wasting memory

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@dsn.lapis-semi.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Tomoya MORINAGA 14 lat temu
rodzic
commit
01631243d7
1 zmienionych plików z 1 dodań i 2 usunięć
  1. 1 2
      drivers/dma/pch_dma.c

+ 1 - 2
drivers/dma/pch_dma.c

@@ -872,8 +872,7 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev,
 	int i;
 	int i;
 
 
 	nr_channels = id->driver_data;
 	nr_channels = id->driver_data;
-	pd = kzalloc(sizeof(struct pch_dma)+
-		sizeof(struct pch_dma_chan) * nr_channels, GFP_KERNEL);
+	pd = kzalloc(sizeof(*pd), GFP_KERNEL);
 	if (!pd)
 	if (!pd)
 		return -ENOMEM;
 		return -ENOMEM;