netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/net/r6040.c: Eliminate double sizeof
@ 2008-06-23 21:12 Julia Lawall
  2008-06-24  8:54 ` Florian Fainelli
  2008-06-27  5:33 ` Jeff Garzik
  0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2008-06-23 21:12 UTC (permalink / raw)
  To: florian.fainelli, jgarzik, netdev, linux-kernel, kernel-janitors

From: Julia Lawall <julia@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@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++;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/net/r6040.c: Eliminate double sizeof
  2008-06-23 21:12 [PATCH] drivers/net/r6040.c: Eliminate double sizeof Julia Lawall
@ 2008-06-24  8:54 ` Florian Fainelli
  2008-06-27  5:33 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2008-06-24  8:54 UTC (permalink / raw)
  To: Julia Lawall; +Cc: jgarzik, netdev, linux-kernel, kernel-janitors

Hello Julia,

Le Monday 23 June 2008 23:12:31 Julia Lawall, vous avez écrit :
> From: Julia Lawall <julia@diku.dk>
>
> Taking sizeof the result of sizeof is quite strange and does not seem to be
> what is wanted here.

Yes, definitively.

> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: Florian Fainelli <florian.fainelli@telecomint.eu>
-- 
Cordialement, Florian Fainelli
------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/net/r6040.c: Eliminate double sizeof
  2008-06-23 21:12 [PATCH] drivers/net/r6040.c: Eliminate double sizeof Julia Lawall
  2008-06-24  8:54 ` Florian Fainelli
@ 2008-06-27  5:33 ` Jeff Garzik
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2008-06-27  5:33 UTC (permalink / raw)
  To: Julia Lawall; +Cc: florian.fainelli, netdev, linux-kernel, kernel-janitors

Julia Lawall wrote:
> From: Julia Lawall <julia@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@diku.dk>

applied



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-27  5:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-23 21:12 [PATCH] drivers/net/r6040.c: Eliminate double sizeof Julia Lawall
2008-06-24  8:54 ` Florian Fainelli
2008-06-27  5:33 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).