Commit ecb8a8472f6d314096f20885722f2033d2071719
Committed by
Linus Torvalds
1 parent
7852375bbb
Exists in
master
and in
7 other branches
pcmcia: convert some internal-only ioaddr_t to unsigned int
Convert the io_req_t members to unsigned int, to allow use on machines with more than 16 bits worth of IO ports (i.e. secondary busses on ppc64, etc). There was only a couple of places in drivers where a change was needed. I left printk formats alone (there are lots of %04x-style formats in there), mostly to not change the format on the platforms that only have 16-bit io addresses, but also because the padding doesn't really add all that much value most of the time. I found only one sprintf of an address, and upsized the string accordingly (I doubt anyone will have anywhere near INT_MAX as irq value, but at least there's room for it now). Signed-off-by: Olof Johansson <olof@lixom.net> Cc: Christoph Hellwig <hch@lst.de> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 4 changed files with 21 additions and 20 deletions Side-by-side Diff
drivers/char/pcmcia/cm4000_cs.c
... | ... | @@ -308,7 +308,8 @@ |
308 | 308 | return (wcrcf / wbrcf); |
309 | 309 | } |
310 | 310 | |
311 | -static unsigned short io_read_num_rec_bytes(ioaddr_t iobase, unsigned short *s) | |
311 | +static unsigned short io_read_num_rec_bytes(unsigned int iobase, | |
312 | + unsigned short *s) | |
312 | 313 | { |
313 | 314 | unsigned short tmp; |
314 | 315 | |
... | ... | @@ -426,7 +427,7 @@ |
426 | 427 | static void set_cardparameter(struct cm4000_dev *dev) |
427 | 428 | { |
428 | 429 | int i; |
429 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
430 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
430 | 431 | u_int8_t stopbits = 0x02; /* ISO default */ |
431 | 432 | |
432 | 433 | DEBUGP(3, dev, "-> set_cardparameter\n"); |
... | ... | @@ -459,7 +460,7 @@ |
459 | 460 | unsigned short num_bytes_read; |
460 | 461 | unsigned char pts_reply[4]; |
461 | 462 | ssize_t rc; |
462 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
463 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
463 | 464 | |
464 | 465 | rc = 0; |
465 | 466 | |
... | ... | @@ -610,7 +611,7 @@ |
610 | 611 | return rc; |
611 | 612 | } |
612 | 613 | |
613 | -static int io_detect_cm4000(ioaddr_t iobase, struct cm4000_dev *dev) | |
614 | +static int io_detect_cm4000(unsigned int iobase, struct cm4000_dev *dev) | |
614 | 615 | { |
615 | 616 | |
616 | 617 | /* note: statemachine is assumed to be reset */ |
... | ... | @@ -671,7 +672,7 @@ |
671 | 672 | static void monitor_card(unsigned long p) |
672 | 673 | { |
673 | 674 | struct cm4000_dev *dev = (struct cm4000_dev *) p; |
674 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
675 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
675 | 676 | unsigned short s; |
676 | 677 | struct ptsreq ptsreq; |
677 | 678 | int i, atrc; |
... | ... | @@ -933,7 +934,7 @@ |
933 | 934 | loff_t *ppos) |
934 | 935 | { |
935 | 936 | struct cm4000_dev *dev = filp->private_data; |
936 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
937 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
937 | 938 | ssize_t rc; |
938 | 939 | int i, j, k; |
939 | 940 | |
... | ... | @@ -1054,7 +1055,7 @@ |
1054 | 1055 | size_t count, loff_t *ppos) |
1055 | 1056 | { |
1056 | 1057 | struct cm4000_dev *dev = (struct cm4000_dev *) filp->private_data; |
1057 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
1058 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
1058 | 1059 | unsigned short s; |
1059 | 1060 | unsigned char tmp; |
1060 | 1061 | unsigned char infolen; |
... | ... | @@ -1408,7 +1409,7 @@ |
1408 | 1409 | unsigned long arg) |
1409 | 1410 | { |
1410 | 1411 | struct cm4000_dev *dev = filp->private_data; |
1411 | - ioaddr_t iobase = dev->p_dev->io.BasePort1; | |
1412 | + unsigned int iobase = dev->p_dev->io.BasePort1; | |
1412 | 1413 | struct pcmcia_device *link; |
1413 | 1414 | int size; |
1414 | 1415 | int rc; |
drivers/pcmcia/pcmcia_resource.c
... | ... | @@ -65,23 +65,23 @@ |
65 | 65 | * Special stuff for managing IO windows, because they are scarce |
66 | 66 | */ |
67 | 67 | |
68 | -static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ioaddr_t *base, | |
69 | - ioaddr_t num, u_int lines) | |
68 | +static int alloc_io_space(struct pcmcia_socket *s, u_int attr, | |
69 | + unsigned int *base, unsigned int num, u_int lines) | |
70 | 70 | { |
71 | 71 | int i; |
72 | - kio_addr_t try, align; | |
72 | + unsigned int try, align; | |
73 | 73 | |
74 | 74 | align = (*base) ? (lines ? 1<<lines : 0) : 1; |
75 | 75 | if (align && (align < num)) { |
76 | 76 | if (*base) { |
77 | - ds_dbg(s, 0, "odd IO request: num %#x align %#lx\n", | |
77 | + ds_dbg(s, 0, "odd IO request: num %#x align %#x\n", | |
78 | 78 | num, align); |
79 | 79 | align = 0; |
80 | 80 | } else |
81 | 81 | while (align && (align < num)) align <<= 1; |
82 | 82 | } |
83 | 83 | if (*base & ~(align-1)) { |
84 | - ds_dbg(s, 0, "odd IO request: base %#x align %#lx\n", | |
84 | + ds_dbg(s, 0, "odd IO request: base %#x align %#x\n", | |
85 | 85 | *base, align); |
86 | 86 | align = 0; |
87 | 87 | } |
... | ... | @@ -132,8 +132,8 @@ |
132 | 132 | } /* alloc_io_space */ |
133 | 133 | |
134 | 134 | |
135 | -static void release_io_space(struct pcmcia_socket *s, ioaddr_t base, | |
136 | - ioaddr_t num) | |
135 | +static void release_io_space(struct pcmcia_socket *s, unsigned int base, | |
136 | + unsigned int num) | |
137 | 137 | { |
138 | 138 | int i; |
139 | 139 |
drivers/scsi/pcmcia/fdomain_stub.c
include/pcmcia/cs.h
... | ... | @@ -147,11 +147,11 @@ |
147 | 147 | |
148 | 148 | /* For RequestIO and ReleaseIO */ |
149 | 149 | typedef struct io_req_t { |
150 | - ioaddr_t BasePort1; | |
151 | - ioaddr_t NumPorts1; | |
150 | + u_int BasePort1; | |
151 | + u_int NumPorts1; | |
152 | 152 | u_int Attributes1; |
153 | - ioaddr_t BasePort2; | |
154 | - ioaddr_t NumPorts2; | |
153 | + u_int BasePort2; | |
154 | + u_int NumPorts2; | |
155 | 155 | u_int Attributes2; |
156 | 156 | u_int IOAddrLines; |
157 | 157 | } io_req_t; |