]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drivers/net/r6040.c: Eliminate double sizeof
authorJulia Lawall <julia@diku.dk>
Mon, 23 Jun 2008 21:12:31 +0000 (23:12 +0200)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 27 Jun 2008 05:28:25 +0000 (01:28 -0400)
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)
- )
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/r6040.c

index 858b191517b3dfc17800147191d0afe4e3f22b1b..504a48ff73c83e5cbac2eaa96c25bdc754bbd40e 100644 (file)
@@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring,
        dma_addr_t mapping = desc_dma;
 
        while (size-- > 0) {
-               mapping += sizeof(sizeof(*desc));
+               mapping += sizeof(*desc);
                desc->ndesc = cpu_to_le32(mapping);
                desc->vndescp = desc + 1;
                desc++;