Commit b17b3df161814c43c03dbc8dbf8d32741bb30ba4

Authored by Stephen Rothwell
Committed by Benjamin Herrenschmidt
1 parent 494fd07a88

powerpc/ps3: The lv1_ routines have u64 parameters

We just fix up the reference parameters as the others are dealt with by
arithmetic promotion rules and don't cause warnings.

This removes warnings like this:

arch/powerpc/platforms/ps3/interrupt.c:327: warning: passing argument 1 of 'lv1_construct_event_receive_port' from incompatible pointer type

Also, these:

drivers/ps3/ps3-vuart.c:462: warning: passing argument 4 of 'ps3_vuart_raw_read' from incompatible pointer type
drivers/ps3/ps3-vuart.c:592: warning: passing argument 4 of 'ps3_vuart_raw_read' from incompatible pointer type

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Showing 5 changed files with 49 additions and 37 deletions Side-by-side Diff

arch/powerpc/platforms/ps3/interrupt.c
... ... @@ -322,7 +322,7 @@
322 322 int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
323 323 {
324 324 int result;
325   - unsigned long outlet;
  325 + u64 outlet;
326 326  
327 327 result = lv1_construct_event_receive_port(&outlet);
328 328  
... ... @@ -468,7 +468,7 @@
468 468 unsigned int *virq)
469 469 {
470 470 int result;
471   - unsigned long outlet;
  471 + u64 outlet;
472 472  
473 473 result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
474 474  
... ... @@ -525,7 +525,7 @@
525 525 unsigned int *virq)
526 526 {
527 527 int result;
528   - unsigned long outlet;
  528 + u64 outlet;
529 529 u64 lpar_addr;
530 530  
531 531 BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
... ... @@ -581,7 +581,7 @@
581 581 unsigned int class, unsigned int *virq)
582 582 {
583 583 int result;
584   - unsigned long outlet;
  584 + u64 outlet;
585 585  
586 586 BUG_ON(class > 2);
587 587  
arch/powerpc/platforms/ps3/mm.c
... ... @@ -79,7 +79,7 @@
79 79 */
80 80  
81 81 struct mem_region {
82   - unsigned long base;
  82 + u64 base;
83 83 unsigned long size;
84 84 unsigned long offset;
85 85 };
... ... @@ -104,8 +104,8 @@
104 104  
105 105 struct map {
106 106 unsigned long total;
107   - unsigned long vas_id;
108   - unsigned long htab_size;
  107 + u64 vas_id;
  108 + u64 htab_size;
109 109 struct mem_region rm;
110 110 struct mem_region r1;
111 111 };
... ... @@ -116,9 +116,9 @@
116 116 {
117 117 DBG("%s:%d: map.total = %lxh\n", func, line, m->total);
118 118 DBG("%s:%d: map.rm.size = %lxh\n", func, line, m->rm.size);
119   - DBG("%s:%d: map.vas_id = %lu\n", func, line, m->vas_id);
120   - DBG("%s:%d: map.htab_size = %lxh\n", func, line, m->htab_size);
121   - DBG("%s:%d: map.r1.base = %lxh\n", func, line, m->r1.base);
  119 + DBG("%s:%d: map.vas_id = %llu\n", func, line, m->vas_id);
  120 + DBG("%s:%d: map.htab_size = %llxh\n", func, line, m->htab_size);
  121 + DBG("%s:%d: map.r1.base = %llxh\n", func, line, m->r1.base);
122 122 DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset);
123 123 DBG("%s:%d: map.r1.size = %lxh\n", func, line, m->r1.size);
124 124 }
... ... @@ -146,11 +146,11 @@
146 146 void __init ps3_mm_vas_create(unsigned long* htab_size)
147 147 {
148 148 int result;
149   - unsigned long start_address;
150   - unsigned long size;
151   - unsigned long access_right;
152   - unsigned long max_page_size;
153   - unsigned long flags;
  149 + u64 start_address;
  150 + u64 size;
  151 + u64 access_right;
  152 + u64 max_page_size;
  153 + u64 flags;
154 154  
155 155 result = lv1_query_logical_partition_address_region_info(0,
156 156 &start_address, &size, &access_right, &max_page_size,
... ... @@ -164,7 +164,7 @@
164 164 }
165 165  
166 166 if (max_page_size < PAGE_SHIFT_16M) {
167   - DBG("%s:%d: bad max_page_size %lxh\n", __func__, __LINE__,
  167 + DBG("%s:%d: bad max_page_size %llxh\n", __func__, __LINE__,
168 168 max_page_size);
169 169 goto fail;
170 170 }
... ... @@ -208,7 +208,7 @@
208 208 {
209 209 int result;
210 210  
211   - DBG("%s:%d: map.vas_id = %lu\n", __func__, __LINE__, map.vas_id);
  211 + DBG("%s:%d: map.vas_id = %llu\n", __func__, __LINE__, map.vas_id);
212 212  
213 213 if (map.vas_id) {
214 214 result = lv1_select_virtual_address_space(0);
... ... @@ -235,7 +235,7 @@
235 235 static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
236 236 {
237 237 int result;
238   - unsigned long muid;
  238 + u64 muid;
239 239  
240 240 r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
241 241  
... ... @@ -277,7 +277,7 @@
277 277 {
278 278 int result;
279 279  
280   - DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base);
  280 + DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
281 281 if (r->base) {
282 282 result = lv1_release_memory(r->base);
283 283 BUG_ON(result);
... ... @@ -648,6 +648,7 @@
648 648 static int dma_sb_region_create(struct ps3_dma_region *r)
649 649 {
650 650 int result;
  651 + u64 bus_addr;
651 652  
652 653 DBG(" -> %s:%d:\n", __func__, __LINE__);
653 654  
... ... @@ -671,7 +672,8 @@
671 672  
672 673 result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id,
673 674 roundup_pow_of_two(r->len), r->page_size, r->region_type,
674   - &r->bus_addr);
  675 + &bus_addr);
  676 + r->bus_addr = bus_addr;
675 677  
676 678 if (result) {
677 679 DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n",
... ... @@ -685,6 +687,7 @@
685 687 static int dma_ioc0_region_create(struct ps3_dma_region *r)
686 688 {
687 689 int result;
  690 + u64 bus_addr;
688 691  
689 692 INIT_LIST_HEAD(&r->chunk_list.head);
690 693 spin_lock_init(&r->chunk_list.lock);
... ... @@ -692,7 +695,8 @@
692 695 result = lv1_allocate_io_segment(0,
693 696 r->len,
694 697 r->page_size,
695   - &r->bus_addr);
  698 + &bus_addr);
  699 + r->bus_addr = bus_addr;
696 700 if (result) {
697 701 DBG("%s:%d: lv1_allocate_io_segment failed: %s\n",
698 702 __func__, __LINE__, ps3_result(result));
arch/powerpc/platforms/ps3/spu.c
... ... @@ -149,7 +149,7 @@
149 149  
150 150 static unsigned long get_vas_id(void)
151 151 {
152   - unsigned long id;
  152 + u64 id;
153 153  
154 154 lv1_get_logical_ppe_id(&id);
155 155 lv1_get_virtual_address_space_id_of_ppe(id, &id);
156 156  
157 157  
... ... @@ -160,14 +160,18 @@
160 160 static int __init construct_spu(struct spu *spu)
161 161 {
162 162 int result;
163   - unsigned long unused;
  163 + u64 unused;
  164 + u64 problem_phys;
  165 + u64 local_store_phys;
164 166  
165 167 result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT,
166 168 PAGE_SHIFT, PAGE_SHIFT, get_vas_id(), SPE_TYPE_LOGICAL,
167   - &spu_pdata(spu)->priv2_addr, &spu->problem_phys,
168   - &spu->local_store_phys, &unused,
  169 + &spu_pdata(spu)->priv2_addr, &problem_phys,
  170 + &local_store_phys, &unused,
169 171 &spu_pdata(spu)->shadow_addr,
170 172 &spu_pdata(spu)->spe_id);
  173 + spu->problem_phys = problem_phys;
  174 + spu->local_store_phys = local_store_phys;
171 175  
172 176 if (result) {
173 177 pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n",
arch/powerpc/platforms/ps3/system-bus.c
... ... @@ -250,9 +250,11 @@
250 250 static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
251 251 {
252 252 int result;
  253 + u64 lpar_addr;
253 254  
254 255 result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,
255   - r->bus_addr, r->len, r->page_size, &r->lpar_addr);
  256 + r->bus_addr, r->len, r->page_size, &lpar_addr);
  257 + r->lpar_addr = lpar_addr;
256 258  
257 259 if (result) {
258 260 pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",
drivers/ps3/ps3-vuart.c
... ... @@ -159,11 +159,13 @@
159 159 struct vuart_triggers *trig)
160 160 {
161 161 int result;
162   - unsigned long size;
163   - unsigned long val;
  162 + u64 size;
  163 + u64 val;
  164 + u64 tx;
164 165  
165 166 result = lv1_get_virtual_uart_param(dev->port_number,
166   - PARAM_TX_TRIGGER, &trig->tx);
  167 + PARAM_TX_TRIGGER, &tx);
  168 + trig->tx = tx;
167 169  
168 170 if (result) {
169 171 dev_dbg(&dev->core, "%s:%d: tx_trigger failed: %s\n",
... ... @@ -201,7 +203,7 @@
201 203 unsigned int rx)
202 204 {
203 205 int result;
204   - unsigned long size;
  206 + u64 size;
205 207  
206 208 result = lv1_set_virtual_uart_param(dev->port_number,
207 209 PARAM_TX_TRIGGER, tx);
... ... @@ -363,7 +365,7 @@
363 365 */
364 366  
365 367 static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
366   - const void *buf, unsigned int bytes, unsigned long *bytes_written)
  368 + const void *buf, unsigned int bytes, u64 *bytes_written)
367 369 {
368 370 int result;
369 371 struct ps3_vuart_port_priv *priv = to_port_priv(dev);
... ... @@ -379,7 +381,7 @@
379 381  
380 382 priv->stats.bytes_written += *bytes_written;
381 383  
382   - dev_dbg(&dev->core, "%s:%d: wrote %lxh/%xh=>%lxh\n", __func__, __LINE__,
  384 + dev_dbg(&dev->core, "%s:%d: wrote %llxh/%xh=>%lxh\n", __func__, __LINE__,
383 385 *bytes_written, bytes, priv->stats.bytes_written);
384 386  
385 387 return result;
... ... @@ -393,7 +395,7 @@
393 395 */
394 396  
395 397 static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
396   - unsigned int bytes, unsigned long *bytes_read)
  398 + unsigned int bytes, u64 *bytes_read)
397 399 {
398 400 int result;
399 401 struct ps3_vuart_port_priv *priv = to_port_priv(dev);
... ... @@ -411,7 +413,7 @@
411 413  
412 414 priv->stats.bytes_read += *bytes_read;
413 415  
414   - dev_dbg(&dev->core, "%s:%d: read %lxh/%xh=>%lxh\n", __func__, __LINE__,
  416 + dev_dbg(&dev->core, "%s:%d: read %llxh/%xh=>%lxh\n", __func__, __LINE__,
415 417 *bytes_read, bytes, priv->stats.bytes_read);
416 418  
417 419 return result;
... ... @@ -500,7 +502,7 @@
500 502 spin_lock_irqsave(&priv->tx_list.lock, flags);
501 503  
502 504 if (list_empty(&priv->tx_list.head)) {
503   - unsigned long bytes_written;
  505 + u64 bytes_written;
504 506  
505 507 result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written);
506 508  
... ... @@ -745,7 +747,7 @@
745 747  
746 748 list_for_each_entry_safe(lb, n, &priv->tx_list.head, link) {
747 749  
748   - unsigned long bytes_written;
  750 + u64 bytes_written;
749 751  
750 752 result = ps3_vuart_raw_write(dev, lb->head, lb->tail - lb->head,
751 753 &bytes_written);
... ... @@ -762,7 +764,7 @@
762 764 if (bytes_written < lb->tail - lb->head) {
763 765 lb->head += bytes_written;
764 766 dev_dbg(&dev->core,
765   - "%s:%d cleared buf_%lu, %lxh bytes\n",
  767 + "%s:%d cleared buf_%lu, %llxh bytes\n",
766 768 __func__, __LINE__, lb->dbg_number,
767 769 bytes_written);
768 770 goto port_full;