Skip to content

Commit b17b3df

Browse files
sfrothwellozbenh
authored andcommitted
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>
1 parent 494fd07 commit b17b3df

5 files changed

Lines changed: 49 additions & 37 deletions

File tree

‎arch/powerpc/platforms/ps3/interrupt.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ EXPORT_SYMBOL_GPL(ps3_irq_plug_destroy);
322322
int ps3_event_receive_port_setup(enum ps3_cpu_binding cpu, unsigned int *virq)
323323
{
324324
int result;
325-
unsigned long outlet;
325+
u64 outlet;
326326

327327
result = lv1_construct_event_receive_port(&outlet);
328328

@@ -468,7 +468,7 @@ int ps3_io_irq_setup(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
468468
unsigned int *virq)
469469
{
470470
int result;
471-
unsigned long outlet;
471+
u64 outlet;
472472

473473
result = lv1_construct_io_irq_outlet(interrupt_id, &outlet);
474474

@@ -525,7 +525,7 @@ int ps3_vuart_irq_setup(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
525525
unsigned int *virq)
526526
{
527527
int result;
528-
unsigned long outlet;
528+
u64 outlet;
529529
u64 lpar_addr;
530530

531531
BUG_ON(!is_kernel_addr((u64)virt_addr_bmp));
@@ -581,7 +581,7 @@ int ps3_spe_irq_setup(enum ps3_cpu_binding cpu, unsigned long spe_id,
581581
unsigned int class, unsigned int *virq)
582582
{
583583
int result;
584-
unsigned long outlet;
584+
u64 outlet;
585585

586586
BUG_ON(class > 2);
587587

‎arch/powerpc/platforms/ps3/mm.c‎

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ enum {
7979
*/
8080

8181
struct mem_region {
82-
unsigned long base;
82+
u64 base;
8383
unsigned long size;
8484
unsigned long offset;
8585
};
@@ -104,8 +104,8 @@ struct mem_region {
104104

105105
struct map {
106106
unsigned long total;
107-
unsigned long vas_id;
108-
unsigned long htab_size;
107+
u64 vas_id;
108+
u64 htab_size;
109109
struct mem_region rm;
110110
struct mem_region r1;
111111
};
@@ -116,9 +116,9 @@ static void __maybe_unused _debug_dump_map(const struct map *m,
116116
{
117117
DBG("%s:%d: map.total = %lxh\n", func, line, m->total);
118118
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);
122122
DBG("%s:%d: map.r1.offset = %lxh\n", func, line, m->r1.offset);
123123
DBG("%s:%d: map.r1.size = %lxh\n", func, line, m->r1.size);
124124
}
@@ -146,11 +146,11 @@ EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
146146
void __init ps3_mm_vas_create(unsigned long* htab_size)
147147
{
148148
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;
154154

155155
result = lv1_query_logical_partition_address_region_info(0,
156156
&start_address, &size, &access_right, &max_page_size,
@@ -164,7 +164,7 @@ void __init ps3_mm_vas_create(unsigned long* htab_size)
164164
}
165165

166166
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__,
168168
max_page_size);
169169
goto fail;
170170
}
@@ -208,7 +208,7 @@ void ps3_mm_vas_destroy(void)
208208
{
209209
int result;
210210

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);
212212

213213
if (map.vas_id) {
214214
result = lv1_select_virtual_address_space(0);
@@ -235,7 +235,7 @@ void ps3_mm_vas_destroy(void)
235235
static int ps3_mm_region_create(struct mem_region *r, unsigned long size)
236236
{
237237
int result;
238-
unsigned long muid;
238+
u64 muid;
239239

240240
r->size = _ALIGN_DOWN(size, 1 << PAGE_SHIFT_16M);
241241

@@ -277,7 +277,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
277277
{
278278
int result;
279279

280-
DBG("%s:%d: r->base = %lxh\n", __func__, __LINE__, r->base);
280+
DBG("%s:%d: r->base = %llxh\n", __func__, __LINE__, r->base);
281281
if (r->base) {
282282
result = lv1_release_memory(r->base);
283283
BUG_ON(result);
@@ -648,6 +648,7 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr,
648648
static int dma_sb_region_create(struct ps3_dma_region *r)
649649
{
650650
int result;
651+
u64 bus_addr;
651652

652653
DBG(" -> %s:%d:\n", __func__, __LINE__);
653654

@@ -671,7 +672,8 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
671672

672673
result = lv1_allocate_device_dma_region(r->dev->bus_id, r->dev->dev_id,
673674
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;
675677

676678
if (result) {
677679
DBG("%s:%d: lv1_allocate_device_dma_region failed: %s\n",
@@ -685,14 +687,16 @@ static int dma_sb_region_create(struct ps3_dma_region *r)
685687
static int dma_ioc0_region_create(struct ps3_dma_region *r)
686688
{
687689
int result;
690+
u64 bus_addr;
688691

689692
INIT_LIST_HEAD(&r->chunk_list.head);
690693
spin_lock_init(&r->chunk_list.lock);
691694

692695
result = lv1_allocate_io_segment(0,
693696
r->len,
694697
r->page_size,
695-
&r->bus_addr);
698+
&bus_addr);
699+
r->bus_addr = bus_addr;
696700
if (result) {
697701
DBG("%s:%d: lv1_allocate_io_segment failed: %s\n",
698702
__func__, __LINE__, ps3_result(result));

‎arch/powerpc/platforms/ps3/spu.c‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ps3_get_spe_id);
149149

150150
static unsigned long get_vas_id(void)
151151
{
152-
unsigned long id;
152+
u64 id;
153153

154154
lv1_get_logical_ppe_id(&id);
155155
lv1_get_virtual_address_space_id_of_ppe(id, &id);
@@ -160,14 +160,18 @@ static unsigned long get_vas_id(void)
160160
static int __init construct_spu(struct spu *spu)
161161
{
162162
int result;
163-
unsigned long unused;
163+
u64 unused;
164+
u64 problem_phys;
165+
u64 local_store_phys;
164166

165167
result = lv1_construct_logical_spe(PAGE_SHIFT, PAGE_SHIFT, PAGE_SHIFT,
166168
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,
169171
&spu_pdata(spu)->shadow_addr,
170172
&spu_pdata(spu)->spe_id);
173+
spu->problem_phys = problem_phys;
174+
spu->local_store_phys = local_store_phys;
171175

172176
if (result) {
173177
pr_debug("%s:%d: lv1_construct_logical_spe failed: %s\n",

‎arch/powerpc/platforms/ps3/system-bus.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,11 @@ static void _dump_mmio_region(const struct ps3_mmio_region* r,
250250
static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)
251251
{
252252
int result;
253+
u64 lpar_addr;
253254

254255
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;
256258

257259
if (result) {
258260
pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",

‎drivers/ps3/ps3-vuart.c‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,13 @@ int ps3_vuart_get_triggers(struct ps3_system_bus_device *dev,
159159
struct vuart_triggers *trig)
160160
{
161161
int result;
162-
unsigned long size;
163-
unsigned long val;
162+
u64 size;
163+
u64 val;
164+
u64 tx;
164165

165166
result = lv1_get_virtual_uart_param(dev->port_number,
166-
PARAM_TX_TRIGGER, &trig->tx);
167+
PARAM_TX_TRIGGER, &tx);
168+
trig->tx = tx;
167169

168170
if (result) {
169171
dev_dbg(&dev->core, "%s:%d: tx_trigger failed: %s\n",
@@ -201,7 +203,7 @@ int ps3_vuart_set_triggers(struct ps3_system_bus_device *dev, unsigned int tx,
201203
unsigned int rx)
202204
{
203205
int result;
204-
unsigned long size;
206+
u64 size;
205207

206208
result = lv1_set_virtual_uart_param(dev->port_number,
207209
PARAM_TX_TRIGGER, tx);
@@ -363,7 +365,7 @@ int ps3_vuart_disable_interrupt_disconnect(struct ps3_system_bus_device *dev)
363365
*/
364366

365367
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)
367369
{
368370
int result;
369371
struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -379,7 +381,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
379381

380382
priv->stats.bytes_written += *bytes_written;
381383

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__,
383385
*bytes_written, bytes, priv->stats.bytes_written);
384386

385387
return result;
@@ -393,7 +395,7 @@ static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
393395
*/
394396

395397
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)
397399
{
398400
int result;
399401
struct ps3_vuart_port_priv *priv = to_port_priv(dev);
@@ -411,7 +413,7 @@ static int ps3_vuart_raw_read(struct ps3_system_bus_device *dev, void *buf,
411413

412414
priv->stats.bytes_read += *bytes_read;
413415

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__,
415417
*bytes_read, bytes, priv->stats.bytes_read);
416418

417419
return result;
@@ -500,7 +502,7 @@ int ps3_vuart_write(struct ps3_system_bus_device *dev, const void *buf,
500502
spin_lock_irqsave(&priv->tx_list.lock, flags);
501503

502504
if (list_empty(&priv->tx_list.head)) {
503-
unsigned long bytes_written;
505+
u64 bytes_written;
504506

505507
result = ps3_vuart_raw_write(dev, buf, bytes, &bytes_written);
506508

@@ -745,7 +747,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
745747

746748
list_for_each_entry_safe(lb, n, &priv->tx_list.head, link) {
747749

748-
unsigned long bytes_written;
750+
u64 bytes_written;
749751

750752
result = ps3_vuart_raw_write(dev, lb->head, lb->tail - lb->head,
751753
&bytes_written);
@@ -762,7 +764,7 @@ static int ps3_vuart_handle_interrupt_tx(struct ps3_system_bus_device *dev)
762764
if (bytes_written < lb->tail - lb->head) {
763765
lb->head += bytes_written;
764766
dev_dbg(&dev->core,
765-
"%s:%d cleared buf_%lu, %lxh bytes\n",
767+
"%s:%d cleared buf_%lu, %llxh bytes\n",
766768
__func__, __LINE__, lb->dbg_number,
767769
bytes_written);
768770
goto port_full;

0 commit comments

Comments
 (0)