aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/firestream.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-06-01 00:26:23 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-06-03 21:08:44 -0400
commitb206a65d671d359d0947f0b6da9d418c49a9b28a (patch)
tree54f18fc433b0706136554d95b516303b809487fe /drivers/atm/firestream.c
parent3f196eb519a419bf83ecc22753943fd0a0de4f8f (diff)
[ATM]: Fix warning.
The compiler warning drivers/atm/firestream.c: In function ‘top_off_fp’: drivers/atm/firestream.c:1505: warning: cast to pointer from integer of different size does indicate a bug, albeit a minor one. Fixed, by using a 32-bit temporary prior to the call to bus_to_virt(). The larger bug is still present: the entire driver assumes that machine pointers are 32-bit, as it stores pointers in 32-bit hardware registers. This is obvious to anyone who knows the driver well, but for the casual readers it is helpfully noted with FIXME. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm/firestream.c')
-rw-r--r--drivers/atm/firestream.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 9c67df5ccfa4..7f6d02ce1b5f 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1475 struct FS_BPENTRY *qe, *ne; 1475 struct FS_BPENTRY *qe, *ne;
1476 struct sk_buff *skb; 1476 struct sk_buff *skb;
1477 int n = 0; 1477 int n = 0;
1478 u32 qe_tmp;
1478 1479
1479 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n", 1480 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n",
1480 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n, 1481 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n,
@@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1502 ne->skb = skb; 1503 ne->skb = skb;
1503 ne->fp = fp; 1504 ne->fp = fp;
1504 1505
1505 qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset))); 1506 /*
1506 fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe); 1507 * FIXME: following code encodes and decodes
1507 if (qe) { 1508 * machine pointers (could be 64-bit) into a
1508 qe = bus_to_virt ((long) qe); 1509 * 32-bit register.
1510 */
1511
1512 qe_tmp = read_fs (dev, FP_EA(fp->offset));
1513 fs_dprintk (FS_DEBUG_QUEUE, "link at %x\n", qe_tmp);
1514 if (qe_tmp) {
1515 qe = bus_to_virt ((long) qe_tmp);
1509 qe->next = virt_to_bus(ne); 1516 qe->next = virt_to_bus(ne);
1510 qe->flags &= ~FP_FLAGS_EPI; 1517 qe->flags &= ~FP_FLAGS_EPI;
1511 } else 1518 } else