Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel
[PATCH] drivers/net/r6040.c: Eliminate double sizeof
 

Index | Next | Previous | View Flat


julia at diku

Jun 23, 2008, 2:12 PM


Views: 682
Permalink
[PATCH] drivers/net/r6040.c: Eliminate double sizeof

From: Julia Lawall <julia[at]diku.dk>

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[at]diku.dk>
---

diff -u -p a/drivers/net/r6040.c b/drivers/net/r6040.c
--- a/drivers/net/r6040.c 2008-06-17 19:46:52.000000000 +0200
+++ b/drivers/net/r6040.c 2008-06-23 22:55:11.000000000 +0200
@@ -273,7 +273,7 @@ static void r6040_init_ring_desc(struct
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++;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Subject User Time
[PATCH] drivers/net/r6040.c: Eliminate double sizeof julia at diku Jun 23, 2008, 2:12 PM
    Re: [PATCH] drivers/net/r6040.c: Eliminate double sizeof florian.fainelli at telecomint Jun 24, 2008, 1:54 AM
    Re: [PATCH] drivers/net/r6040.c: Eliminate double sizeof jgarzik at pobox Jun 26, 2008, 10:33 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.