Skip to content

Commit

Permalink
drivers/net/r6040.c: Eliminate double sizeof
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Jeff Garzik committed Jun 27, 2008
1 parent 54299ef commit 3f6602a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 3f6602a

Please sign in to comment.