[lkml]   [2005]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] epca iomem annotations + several missing readw()


On Thu, 15 Sep 2005, Al Viro wrote:
> { /* Begin post_fep_init */
> int i;
> - unsigned char *memaddr;
> - struct global_data *gd;
> + unsigned char __iomem *memaddr;
> + struct global_data __iomem *gd;

Please don't use "[unsigned] char __iomem *".

Why? Two reasons:

- it's pointless. You can't dereference it anyway, and unlike a struct or
an array, it has no addressing capabilities that "void __iomem *"
doesn't have (gcc extension that the kernel uses widely).

Dereferencing needs "read/write[bwl]()" anyway.

- it results in horrors like this:

> - bc = (struct board_chan *)(memaddr + CHANSTRUCT);
> + bc = (struct board_chan __iomem *)(memaddr + CHANSTRUCT);

which could instead be nicely written as

bc = memaddr + CHANSTRUCT;

if "memaddr" were just a "void __iomem *".

I bet the patch would look like a nice cleanup if you did that. Hint,

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2009-11-18 23:46    [W:0.043 / U:0.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site