----- End forwarded message -----
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,
hint.
Linus
Not a problem, I simply wanted to keep __iomem stuff apart from driver
cleanups.
> Why? Two reasons:
[obvious - we are in full agreement here]
> I bet the patch would look like a nice cleanup if you did that. Hint,
> hint.
OK... I'd rather do that as an incremental, to keep unrelated changes
separate, but I can merge them if you prefer it that way.
Here it is... Note that I've kept ->rxptr and ->txptr iomem pointers to
char - that's what they really are and for these suckers we do not get
any casts, etc.
Signed-off-by: Al Viro <vi...@zeniv.linux.org.uk>
----
diff -urN RC14-rc1-lne390/drivers/char/epca.c RC14-rc1-epca/drivers/char/epca.c
--- RC14-rc1-lne390/drivers/char/epca.c 2005-09-08 10:07:30.000000000 -0400
+++ RC14-rc1-epca/drivers/char/epca.c 2005-09-15 17:49:04.000000000 -0400
{ /* Begin post_fep_init */
int i;
- unsigned char *memaddr;
- struct global_data *gd;
+ void __iomem *memaddr;
+ struct global_data __iomem *gd;
struct board_info *bd;
- struct board_chan *bc;
+ struct board_chan __iomem *bc;
struct channel *ch;
int shrinkmem = 0, lowwater ;
@@ -1461,7 +1461,7 @@
8 and 64 of these structures.
-------------------------------------------------------------------- */
- bc = (struct board_chan *)(memaddr + CHANSTRUCT);
+ bc = memaddr + CHANSTRUCT;
/* -------------------------------------------------------------------
The below assignment will set gd to point at the BEGINING of
@@ -1470,7 +1470,7 @@
pointer begins at 0xd10.
---------------------------------------------------------------------- */
- gd = (struct global_data *)(memaddr + GLOBAL);
+ gd = memaddr + GLOBAL;
diff -urN RC14-rc1-lne390/drivers/char/epca.h RC14-rc1-epca/drivers/char/epca.h
--- RC14-rc1-lne390/drivers/char/epca.h 2005-09-08 10:07:30.000000000 -0400
+++ RC14-rc1-epca/drivers/char/epca.h 2005-09-15 17:49:04.000000000 -0400
@@ -128,17 +128,17 @@
unsigned long c_cflag;
unsigned long c_lflag;
unsigned long c_oflag;
- unsigned char *txptr;
- unsigned char *rxptr;
+ unsigned char __iomem *txptr;
+ unsigned char __iomem *rxptr;
unsigned char *tmp_buf;
struct board_info *board;
- struct board_chan *brdchan;
+ struct board_chan __iomem *brdchan;
struct digi_struct digiext;
struct tty_struct *tty;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
struct work_struct tqueue;
- struct global_data *mailbox;
+ struct global_data __iomem *mailbox;
};
struct board_info
@@ -149,8 +149,8 @@
unsigned short numports;
unsigned long port;
unsigned long membase;
- unsigned char __iomem *re_map_port;
- unsigned char *re_map_membase;
+ void __iomem *re_map_port;
+ void __iomem *re_map_membase;
unsigned long memory_seg;
void ( * memwinon ) (struct board_info *, unsigned int) ;
void ( * memwinoff ) (struct board_info *, unsigned int) ;
Thanks for copying me, but I have no interest in any serial driver
which doesn't use the serial core interface.
I don't want to act as "person to review any change just because the
driver says serial" - that's not the role I decided to get involved
with.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
Hey, seeing the intensity of your complaints about _not_ being Cc'd...
Better safe than serial maintainer ;-)
OK, so what stuff do you want to be Cc'd on? My current approximation
would be arch/arm/*, include/asm-arm/*,drivers/serial/*,include/linux/serial*.
Well, and any changes of tty interfaces, if I ever get involved in such...
Any additions/removals?
My feelings as well when I get random serial bugs in bugzilla for drivers
I have zero clue about and no one to assign them to. 8/
> OK, so what stuff do you want to be Cc'd on? My current approximation
> would be arch/arm/*, include/asm-arm/*,drivers/serial/*,include/linux/serial*.
> Well, and any changes of tty interfaces, if I ever get involved in such...
> Any additions/removals?
Broadly, it's:
arch/arm/*
drivers/*/arm
drivers/mfd/* (this fits at the moment, but whether it will in
the future depends what else appears there.)
drivers/mmc/*
drivers/serial* (though only the drivers in there actually using
serial_core - unfortunately some non-serial_core
drivers appear to have been placed in there.)
include/asm-arm/*
include/linux/8250*
include/linux/serial*
fs/adfs/*
but there are various drivers authored by myself which I'd obviously be
interested in CC'ed.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core