Re: [RFC] mmiotrace full patch, preview 1

From: Pekka Paalanen
Date: Tue Feb 26 2008 - 15:03:19 EST


On Mon, 25 Feb 2008 14:49:22 -0800
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> Please feed the diff through scritps/checkpatch.pl and consider addressing
> the things which it finds.

I checked that, but I didn't think any of them were worth fixing. And
since this is a work in progress and a in a state which I do not want
committed yet, I did not sign this patch. mmio-mod.c is still a mess.

> WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
> #1097: FILE: arch/x86/mm/mmio-mod.c:437:
> +void iounmap_trace(volatile void __iomem *addr)

I believe the 'volatile' belongs here, it is also in the declaration of
iounmap() in arch/x86/mm/ioremap.c.

> WARNING: externs should be avoided in .c files
> #1766: FILE: arch/x86/mm/testmmiotrace.c:7:
> +extern void __iomem *ioremap_nocache_trace(unsigned long offset,
>
> WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
> #1768: FILE: arch/x86/mm/testmmiotrace.c:9:
> +extern void iounmap_trace(volatile void __iomem *addr);
>
> WARNING: externs should be avoided in .c files
> #1768: FILE: arch/x86/mm/testmmiotrace.c:9:
> +extern void iounmap_trace(volatile void __iomem *addr);

These are all in testmmiotrace.c which calls the traced ioremap
functions directly. These direct calls will go away and it will
call the normal ioremap functions.

> WARNING: Use of volatile is usually wrong: see Documentation/volatile-considered-harmful.txt
> #1790: FILE: arch/x86/mm/testmmiotrace.c:31:
> + volatile unsigned int v;

Since testmmiotrace does not use v for anything other than return value
of ioread8/16/32(), I wanted to prevent the compiler from optimizing
it away. Now thinking it again, ioread*() must guarantee that the read
is always executed. I'll remove v altogether.

Patch for the other issues you mentioned is brewing.


Thanks.

--
Pekka Paalanen
http://www.iki.fi/pq/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/