[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition

Jared Hulbert jaredeh at gmail.com
Fri Aug 3 01:23:47 EDT 2007


> Interestingly __iomem makes less sense for some RAM-based drivers.  So
> maybe that part should get removed.

(http://marc.info/?l=linux-arm-kernel&m=118193919321290&w=4)
  Russel King said:
-->
-->   const void *start = virt + offset;
-->
--> This will generate a sparse warning (since you haven't used sparse you
--> won't know about this.)  The __iomem annotation does nothing as far as
--> the C language goes, but sparse uses it to annotate variables as to
--> which address space they refer to, and issues warnings if you try to
--> cast between different address spaces.  However, it does allow code
--> which knows what it's doing to do such casts.
-->
-->   const void *start = (void __force *)virt + offset;
-->
--> MTD people may like to make a note that the 'cached' element of struct
--> map_info is assigned __iomem pointers (from ioremap_cached) but is
--> itself not marked with an __iomem pointer.  This will also produce
--> sparse warnings.

Now I think maybe it should be "void **virt" not "void __iomem **virt"
and then just __force virt.  Anybody know?

> The whole patch was just a quick hack to get an opinion.

Trying to move it forward...



More information about the linux-mtd mailing list