]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: OMAP: Improve a size determination in two functions
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 3 Oct 2017 18:46:48 +0000 (20:46 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 11 Oct 2017 18:13:04 +0000 (11:13 -0700)
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c
arch/arm/plat-omap/dmtimer.c

index 6ede0427548c2ac9afe0885c9696a4bf653370ff..409e4ecaebe920654918fe40be1c30f981445966 100644 (file)
@@ -1316,7 +1316,7 @@ static int omap_system_dma_probe(struct platform_device *pdev)
        enable_1510_mode        = d->dev_caps & ENABLE_1510_MODE;
 
        dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count,
-                               sizeof(struct omap_dma_lch), GFP_KERNEL);
+                               sizeof(*dma_chan), GFP_KERNEL);
        if (!dma_chan)
                return -ENOMEM;
 
index 446ac0e3a35af755efda73930700ba08a33e27b3..14779d6f425d43390d08a43615fd182651f16f56 100644 (file)
@@ -857,7 +857,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL);
+       timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL);
        if (!timer)
                return  -ENOMEM;