ionic: fix sizeof usage
authorShannon Nelson <snelson@pensando.io>
Tue, 30 Mar 2021 19:52:08 +0000 (12:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2021 00:37:12 +0000 (17:37 -0700)
Use the actual pointer that we care about as the subject of the
sizeof, rather than a struct name.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index 889d234..a51be25 100644 (file)
@@ -676,20 +676,20 @@ static int ionic_qcqs_alloc(struct ionic_lif *lif)
 
        err = -ENOMEM;
        lif->txqcqs = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif,
-                                  sizeof(struct ionic_qcq *), GFP_KERNEL);
+                                  sizeof(*lif->txqcqs), GFP_KERNEL);
        if (!lif->txqcqs)
                goto err_out;
        lif->rxqcqs = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif,
-                                  sizeof(struct ionic_qcq *), GFP_KERNEL);
+                                  sizeof(*lif->rxqcqs), GFP_KERNEL);
        if (!lif->rxqcqs)
                goto err_out;
 
        lif->txqstats = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif,
-                                    sizeof(struct ionic_tx_stats), GFP_KERNEL);
+                                    sizeof(*lif->txqstats), GFP_KERNEL);
        if (!lif->txqstats)
                goto err_out;
        lif->rxqstats = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif,
-                                    sizeof(struct ionic_rx_stats), GFP_KERNEL);
+                                    sizeof(*lif->rxqstats), GFP_KERNEL);
        if (!lif->rxqstats)
                goto err_out;