History

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.

Prarit Bhargava committed 16 years ago

Commit cdf8afc1 parent 7efe15f2 files · +13 −12Browse files

Unified · Split

2 files
  1. drivers/misc/hpilo.c +9 −8
  2. drivers/misc/hpilo.h +4 −4
drivers/misc/hpilo.c+9−8
@@ -256,7 +256,8 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data) · 255 unmodified lines
256 256
257static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)257static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot)
258{258{
259 char *dma_va, *dma_pa;259 char *dma_va;
260 dma_addr_t dma_pa;
260 struct ccb *driver_ccb, *ilo_ccb;261 struct ccb *driver_ccb, *ilo_ccb;
261 262
262 driver_ccb = &data->driver_ccb;263 driver_ccb = &data->driver_ccb;
@@ -272,12 +273,12 @@ static int ilo_ccb_setup(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) · 9 unmodified lines
272 return -ENOMEM;273 return -ENOMEM;
273 274
274 dma_va = (char *)data->dma_va;275 dma_va = (char *)data->dma_va;
275 dma_pa = (char *)data->dma_pa;276 dma_pa = data->dma_pa;
276 277
277 memset(dma_va, 0, data->dma_size);278 memset(dma_va, 0, data->dma_size);
278 279
279 dma_va = (char *)roundup((unsigned long)dma_va, ILO_START_ALIGN);280 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);
281 282
282 /*283 /*
283 * Create two ccb's, one with virt addrs, one with phys addrs.284 * 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) · 4 unmodified lines
288 289
289 fifo_setup(dma_va, NR_QENTRY);290 fifo_setup(dma_va, NR_QENTRY);
290 driver_ccb->ccb_u1.send_fifobar = dma_va + FIFOHANDLESIZE;291 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;
292 dma_va += fifo_sz(NR_QENTRY);293 dma_va += fifo_sz(NR_QENTRY);
293 dma_pa += fifo_sz(NR_QENTRY);294 dma_pa += fifo_sz(NR_QENTRY);
294 295
295 dma_va = (char *)roundup((unsigned long)dma_va, ILO_CACHE_SZ);296 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);
297 298
298 fifo_setup(dma_va, NR_QENTRY);299 fifo_setup(dma_va, NR_QENTRY);
299 driver_ccb->ccb_u3.recv_fifobar = dma_va + FIFOHANDLESIZE;300 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;
301 dma_va += fifo_sz(NR_QENTRY);302 dma_va += fifo_sz(NR_QENTRY);
302 dma_pa += fifo_sz(NR_QENTRY);303 dma_pa += fifo_sz(NR_QENTRY);
303 304
304 driver_ccb->ccb_u2.send_desc = dma_va;305 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;
306 dma_pa += desc_mem_sz(NR_QENTRY);307 dma_pa += desc_mem_sz(NR_QENTRY);
307 dma_va += desc_mem_sz(NR_QENTRY);308 dma_va += desc_mem_sz(NR_QENTRY);
308 309
309 driver_ccb->ccb_u4.recv_desc = dma_va;310 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;
311 312
312 driver_ccb->channel = slot;313 driver_ccb->channel = slot;
313 ilo_ccb->channel = slot;314 ilo_ccb->channel = slot;
drivers/misc/hpilo.h+4−4
@@ -79,21 +79,21 @@ struct ilo_hwinfo { · 78 unmodified lines
79struct ccb {79struct ccb {
80 union {80 union {
81 char *send_fifobar;81 char *send_fifobar;
82 u64 padding1;82 u64 send_fifobar_pa;
83 } ccb_u1;83 } ccb_u1;
84 union {84 union {
85 char *send_desc;85 char *send_desc;
86 u64 padding2;86 u64 send_desc_pa;
87 } ccb_u2;87 } ccb_u2;
88 u64 send_ctrl;88 u64 send_ctrl;
89 89
90 union {90 union {
91 char *recv_fifobar;91 char *recv_fifobar;
92 u64 padding3;92 u64 recv_fifobar_pa;
93 } ccb_u3;93 } ccb_u3;
94 union {94 union {
95 char *recv_desc;95 char *recv_desc;
96 u64 padding4;96 u64 recv_desc_pa;
97 } ccb_u4;97 } ccb_u4;
98 u64 recv_ctrl;98 u64 recv_ctrl;
99 99

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t