提交 cdf8afca 编写于 作者: P Prarit Bhargava 提交者: Linus Torvalds

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: NPrarit Bhargava <prarit@redhat.com>
Acked-by: NDavid Altobelli <david.altobelli@hp.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7efe15f2
...@@ -256,7 +256,8 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data) ...@@ -256,7 +256,8 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data)
static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
{ {
char *dma_va, *dma_pa; char *dma_va;
dma_addr_t dma_pa;
struct ccb *driver_ccb, *ilo_ccb; struct ccb *driver_ccb, *ilo_ccb;
driver_ccb = &data->driver_ccb; driver_ccb = &data->driver_ccb;
...@@ -272,12 +273,12 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) ...@@ -272,12 +273,12 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
return -ENOMEM; return -ENOMEM;
dma_va = (char *)data->dma_va; dma_va = (char *)data->dma_va;
dma_pa = (char *)data->dma_pa; dma_pa = data->dma_pa;
memset(dma_va, 0, data->dma_size); memset(dma_va, 0, data->dma_size);
dma_va = (char *)roundup((unsigned long)dma_va, ILO_START_ALIGN); dma_va = (char *)roundup((unsigned long)dma_va, ILO_START_ALIGN);
dma_pa = (char *)roundup((unsigned long)dma_pa, ILO_START_ALIGN); dma_pa = roundup(dma_pa, ILO_START_ALIGN);
/* /*
* Create two ccb's, one with virt addrs, one with phys addrs. * 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) ...@@ -288,26 +289,26 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
fifo_setup(dma_va, NR_QENTRY); fifo_setup(dma_va, NR_QENTRY);
driver_ccb->ccb_u1.send_fifobar = dma_va + FIFOHANDLESIZE; driver_ccb->ccb_u1.send_fifobar = dma_va + FIFOHANDLESIZE;
ilo_ccb->ccb_u1.send_fifobar = dma_pa + FIFOHANDLESIZE; ilo_ccb->ccb_u1.send_fifobar_pa = dma_pa + FIFOHANDLESIZE;
dma_va += fifo_sz(NR_QENTRY); dma_va += fifo_sz(NR_QENTRY);
dma_pa += fifo_sz(NR_QENTRY); dma_pa += fifo_sz(NR_QENTRY);
dma_va = (char *)roundup((unsigned long)dma_va, ILO_CACHE_SZ); dma_va = (char *)roundup((unsigned long)dma_va, ILO_CACHE_SZ);
dma_pa = (char *)roundup((unsigned long)dma_pa, ILO_CACHE_SZ); dma_pa = roundup(dma_pa, ILO_CACHE_SZ);
fifo_setup(dma_va, NR_QENTRY); fifo_setup(dma_va, NR_QENTRY);
driver_ccb->ccb_u3.recv_fifobar = dma_va + FIFOHANDLESIZE; driver_ccb->ccb_u3.recv_fifobar = dma_va + FIFOHANDLESIZE;
ilo_ccb->ccb_u3.recv_fifobar = dma_pa + FIFOHANDLESIZE; ilo_ccb->ccb_u3.recv_fifobar_pa = dma_pa + FIFOHANDLESIZE;
dma_va += fifo_sz(NR_QENTRY); dma_va += fifo_sz(NR_QENTRY);
dma_pa += fifo_sz(NR_QENTRY); dma_pa += fifo_sz(NR_QENTRY);
driver_ccb->ccb_u2.send_desc = dma_va; driver_ccb->ccb_u2.send_desc = dma_va;
ilo_ccb->ccb_u2.send_desc = dma_pa; ilo_ccb->ccb_u2.send_desc_pa = dma_pa;
dma_pa += desc_mem_sz(NR_QENTRY); dma_pa += desc_mem_sz(NR_QENTRY);
dma_va += desc_mem_sz(NR_QENTRY); dma_va += desc_mem_sz(NR_QENTRY);
driver_ccb->ccb_u4.recv_desc = dma_va; driver_ccb->ccb_u4.recv_desc = dma_va;
ilo_ccb->ccb_u4.recv_desc = dma_pa; ilo_ccb->ccb_u4.recv_desc_pa = dma_pa;
driver_ccb->channel = slot; driver_ccb->channel = slot;
ilo_ccb->channel = slot; ilo_ccb->channel = slot;
......
...@@ -79,21 +79,21 @@ struct ilo_hwinfo { ...@@ -79,21 +79,21 @@ struct ilo_hwinfo {
struct ccb { struct ccb {
union { union {
char *send_fifobar; char *send_fifobar;
u64 padding1; u64 send_fifobar_pa;
} ccb_u1; } ccb_u1;
union { union {
char *send_desc; char *send_desc;
u64 padding2; u64 send_desc_pa;
} ccb_u2; } ccb_u2;
u64 send_ctrl; u64 send_ctrl;
union { union {
char *recv_fifobar; char *recv_fifobar;
u64 padding3; u64 recv_fifobar_pa;
} ccb_u3; } ccb_u3;
union { union {
char *recv_desc; char *recv_desc;
u64 padding4; u64 recv_desc_pa;
} ccb_u4; } ccb_u4;
u64 recv_ctrl; u64 recv_ctrl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册