* [PATCH] arch/powerpc: Eliminate double sizeof
@ 2009-02-04 21:43 Julia Lawall
2009-02-04 22:13 ` Scott Wood
2009-02-06 16:44 ` Kumar Gala
0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2009-02-04 21:43 UTC (permalink / raw)
To: galak, linuxppc-dev, 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)
- )
@@
type T;
@@
- sizeof (
sizeof (T)
- )
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -186,7 +186,7 @@ out_unmap_regs:
iounmap(priv->regs);
out_free_bootmem:
free_bootmem((unsigned long)priv,
- sizeof(sizeof(struct pq2ads_pci_pic)));
+ sizeof(struct pq2ads_pci_pic));
of_node_put(np);
out_unmap_irq:
irq_dispose_mapping(irq);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arch/powerpc: Eliminate double sizeof
2009-02-04 21:43 [PATCH] arch/powerpc: Eliminate double sizeof Julia Lawall
@ 2009-02-04 22:13 ` Scott Wood
2009-02-06 16:44 ` Kumar Gala
1 sibling, 0 replies; 3+ messages in thread
From: Scott Wood @ 2009-02-04 22:13 UTC (permalink / raw)
To: Julia Lawall; +Cc: linuxppc-dev, kernel-janitors, linux-kernel
Julia Lawall wrote:
> Signed-off-by: Julia Lawall <julia@diku.dk>
> ---
> arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -u -p a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
> --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
> +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
> @@ -186,7 +186,7 @@ out_unmap_regs:
> iounmap(priv->regs);
> out_free_bootmem:
> free_bootmem((unsigned long)priv,
> - sizeof(sizeof(struct pq2ads_pci_pic)));
> + sizeof(struct pq2ads_pci_pic));
> of_node_put(np);
> out_unmap_irq:
> irq_dispose_mapping(irq);
ACK
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arch/powerpc: Eliminate double sizeof
2009-02-04 21:43 [PATCH] arch/powerpc: Eliminate double sizeof Julia Lawall
2009-02-04 22:13 ` Scott Wood
@ 2009-02-06 16:44 ` Kumar Gala
1 sibling, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2009-02-06 16:44 UTC (permalink / raw)
To: Julia Lawall; +Cc: linuxppc-dev, kernel-janitors, linux-kernel
On Feb 4, 2009, at 3:43 PM, 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)
> - )
>
> @@
> type T;
> @@
>
> - sizeof (
> sizeof (T)
> - )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
> ---
> arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
applied
- k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-06 16:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-04 21:43 [PATCH] arch/powerpc: Eliminate double sizeof Julia Lawall
2009-02-04 22:13 ` Scott Wood
2009-02-06 16:44 ` Kumar Gala
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).