Skip to content

Commit cdf8afc

Browse files
prarittorvalds
authored andcommitted
hpilo: fix pointer warning in ilo_ccb_setup
Fix i386 PAE compile warning: drivers/misc/hpilo.c: In function `ilo_ccb_setup': drivers/misc/hpilo.c:274: warning: cast to pointer from integer of different size dma_addr_t is 64 on i386 PAE which causes a size mismatch. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Acked-by: David Altobelli <david.altobelli@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7efe15f commit cdf8afc

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎drivers/misc/hpilo.c‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data)
256256

257257
static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
258258
{
259-
char *dma_va, *dma_pa;
259+
char *dma_va;
260+
dma_addr_t dma_pa;
260261
struct ccb *driver_ccb, *ilo_ccb;
261262

262263
driver_ccb = &data->driver_ccb;
@@ -272,12 +273,12 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
272273
return -ENOMEM;
273274

274275
dma_va = (char *)data->dma_va;
275-
dma_pa = (char *)data->dma_pa;
276+
dma_pa = data->dma_pa;
276277

277278
memset(dma_va, 0, data->dma_size);
278279

279280
dma_va = (char *)roundup((unsigned long)dma_va, ILO_START_ALIGN);
280-
dma_pa = (char *)roundup((unsigned long)dma_pa, ILO_START_ALIGN);
281+
dma_pa = roundup(dma_pa, ILO_START_ALIGN);
281282

282283
/*
283284
* Create two ccb's, one with virt addrs, one with phys addrs.
@@ -288,26 +289,26 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
288289

289290
fifo_setup(dma_va, NR_QENTRY);
290291
driver_ccb->ccb_u1.send_fifobar = dma_va + FIFOHANDLESIZE;
291-
ilo_ccb->ccb_u1.send_fifobar = dma_pa + FIFOHANDLESIZE;
292+
ilo_ccb->ccb_u1.send_fifobar_pa = dma_pa + FIFOHANDLESIZE;
292293
dma_va += fifo_sz(NR_QENTRY);
293294
dma_pa += fifo_sz(NR_QENTRY);
294295

295296
dma_va = (char *)roundup((unsigned long)dma_va, ILO_CACHE_SZ);
296-
dma_pa = (char *)roundup((unsigned long)dma_pa, ILO_CACHE_SZ);
297+
dma_pa = roundup(dma_pa, ILO_CACHE_SZ);
297298

298299
fifo_setup(dma_va, NR_QENTRY);
299300
driver_ccb->ccb_u3.recv_fifobar = dma_va + FIFOHANDLESIZE;
300-
ilo_ccb->ccb_u3.recv_fifobar = dma_pa + FIFOHANDLESIZE;
301+
ilo_ccb->ccb_u3.recv_fifobar_pa = dma_pa + FIFOHANDLESIZE;
301302
dma_va += fifo_sz(NR_QENTRY);
302303
dma_pa += fifo_sz(NR_QENTRY);
303304

304305
driver_ccb->ccb_u2.send_desc = dma_va;
305-
ilo_ccb->ccb_u2.send_desc = dma_pa;
306+
ilo_ccb->ccb_u2.send_desc_pa = dma_pa;
306307
dma_pa += desc_mem_sz(NR_QENTRY);
307308
dma_va += desc_mem_sz(NR_QENTRY);
308309

309310
driver_ccb->ccb_u4.recv_desc = dma_va;
310-
ilo_ccb->ccb_u4.recv_desc = dma_pa;
311+
ilo_ccb->ccb_u4.recv_desc_pa = dma_pa;
311312

312313
driver_ccb->channel = slot;
313314
ilo_ccb->channel = slot;

‎drivers/misc/hpilo.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ struct ilo_hwinfo {
7979
struct ccb {
8080
union {
8181
char *send_fifobar;
82-
u64 padding1;
82+
u64 send_fifobar_pa;
8383
} ccb_u1;
8484
union {
8585
char *send_desc;
86-
u64 padding2;
86+
u64 send_desc_pa;
8787
} ccb_u2;
8888
u64 send_ctrl;
8989

9090
union {
9191
char *recv_fifobar;
92-
u64 padding3;
92+
u64 recv_fifobar_pa;
9393
} ccb_u3;
9494
union {
9595
char *recv_desc;
96-
u64 padding4;
96+
u64 recv_desc_pa;
9797
} ccb_u4;
9898
u64 recv_ctrl;
9999

0 commit comments

Comments
 (0)