提交 3f6602ad 编写于 作者: J Julia Lawall 提交者: Jeff Garzik

drivers/net/r6040.c: Eliminate double sizeof

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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 54299ef7
...@@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring, ...@@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring,
dma_addr_t mapping = desc_dma; dma_addr_t mapping = desc_dma;
while (size-- > 0) { while (size-- > 0) {
mapping += sizeof(sizeof(*desc)); mapping += sizeof(*desc);
desc->ndesc = cpu_to_le32(mapping); desc->ndesc = cpu_to_le32(mapping);
desc->vndescp = desc + 1; desc->vndescp = desc + 1;
desc++; desc++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册