]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
arch/powerpc: Eliminate double sizeof
authorJulia Lawall <julia@diku.dk>
Wed, 4 Feb 2009 21:43:04 +0000 (22:43 +0100)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 6 Feb 2009 16:44:28 +0000 (10:44 -0600)
Taking sizeof the result of sizeof is quite strange and does not seem to be
what is wanted here.

This was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E;
@@

- sizeof (
  sizeof (E)
- )

@@
type T;
@@

- sizeof (
  sizeof (T)
- )
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c

index 9876d7e072f46b3f825dc9df9683ac2b573cf1ae..ddf0bdc0fc8ba1a6845fb283a5330d21ab0701ce 100644 (file)
@@ -186,7 +186,7 @@ out_unmap_regs:
        iounmap(priv->regs);
 out_free_bootmem:
        free_bootmem((unsigned long)priv,
-                    sizeof(sizeof(struct pq2ads_pci_pic)));
+                    sizeof(struct pq2ads_pci_pic));
        of_node_put(np);
 out_unmap_irq:
        irq_dispose_mapping(irq);