Commit de8782f1 authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

'hw_status_page' looks like a pointer, quacks like a pointer and

walks like a pointer. It _is_ a pointer. So make it one, and remove
a lot of silly casts.
parent bc4ff576
...@@ -55,7 +55,7 @@ static inline void i810_print_status_page(drm_device_t *dev) ...@@ -55,7 +55,7 @@ static inline void i810_print_status_page(drm_device_t *dev)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = dev->dev_private; drm_i810_private_t *dev_priv = dev->dev_private;
u32 *temp = (u32 *)dev_priv->hw_status_page; u32 *temp = dev_priv->hw_status_page;
int i; int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]); DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
...@@ -240,9 +240,9 @@ static int i810_dma_cleanup(drm_device_t *dev) ...@@ -240,9 +240,9 @@ static int i810_dma_cleanup(drm_device_t *dev)
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size); dev_priv->ring.Size);
} }
if(dev_priv->hw_status_page != 0UL) { if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE, pci_free_consistent(dev->pdev, PAGE_SIZE,
(void *)dev_priv->hw_status_page, dev_priv->hw_status_page,
dev_priv->dma_status_page); dev_priv->dma_status_page);
/* Need to rewrite hardware status page */ /* Need to rewrite hardware status page */
I810_WRITE(0x02080, 0x1ffff000); I810_WRITE(0x02080, 0x1ffff000);
...@@ -405,15 +405,15 @@ static int i810_dma_initialize(drm_device_t *dev, ...@@ -405,15 +405,15 @@ static int i810_dma_initialize(drm_device_t *dev,
/* Program Hardware Status Page */ /* Program Hardware Status Page */
dev_priv->hw_status_page = dev_priv->hw_status_page =
(unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE, pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page); &dev_priv->dma_status_page);
if(dev_priv->hw_status_page == 0UL) { if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv; dev->dev_private = (void *)dev_priv;
i810_dma_cleanup(dev); i810_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n"); DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM; return -ENOMEM;
} }
memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE); memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page); DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page);
I810_WRITE(0x02080, dev_priv->dma_status_page); I810_WRITE(0x02080, dev_priv->dma_status_page);
...@@ -899,7 +899,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp, ...@@ -899,7 +899,7 @@ int i810_dma_vertex(struct inode *inode, struct file *filp,
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
drm_i810_vertex_t vertex; drm_i810_vertex_t vertex;
...@@ -975,7 +975,7 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd, ...@@ -975,7 +975,7 @@ int i810_getage(struct inode *inode, struct file *filp, unsigned int cmd,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
...@@ -991,7 +991,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, ...@@ -991,7 +991,7 @@ int i810_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
int retcode = 0; int retcode = 0;
drm_i810_dma_t d; drm_i810_dma_t d;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
...@@ -1100,7 +1100,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp, ...@@ -1100,7 +1100,7 @@ int i810_dma_mc(struct inode *inode, struct file *filp,
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *) drm_i810_sarea_t *sarea_priv = (drm_i810_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
drm_i810_mc_t mc; drm_i810_mc_t mc;
......
...@@ -61,7 +61,7 @@ typedef struct drm_i810_private { ...@@ -61,7 +61,7 @@ typedef struct drm_i810_private {
drm_i810_sarea_t *sarea_priv; drm_i810_sarea_t *sarea_priv;
drm_i810_ring_buffer_t ring; drm_i810_ring_buffer_t ring;
unsigned long hw_status_page; void *hw_status_page;
unsigned long counter; unsigned long counter;
dma_addr_t dma_status_page; dma_addr_t dma_status_page;
......
...@@ -56,7 +56,7 @@ static inline void i830_print_status_page(drm_device_t *dev) ...@@ -56,7 +56,7 @@ static inline void i830_print_status_page(drm_device_t *dev)
{ {
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = dev->dev_private; drm_i830_private_t *dev_priv = dev->dev_private;
u32 *temp = (u32 *)dev_priv->hw_status_page; u32 *temp = dev_priv->hw_status_page;
int i; int i;
DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]); DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]);
...@@ -240,9 +240,9 @@ static int i830_dma_cleanup(drm_device_t *dev) ...@@ -240,9 +240,9 @@ static int i830_dma_cleanup(drm_device_t *dev)
DRM(ioremapfree)((void *) dev_priv->ring.virtual_start, DRM(ioremapfree)((void *) dev_priv->ring.virtual_start,
dev_priv->ring.Size); dev_priv->ring.Size);
} }
if(dev_priv->hw_status_page != 0UL) { if (dev_priv->hw_status_page) {
pci_free_consistent(dev->pdev, PAGE_SIZE, pci_free_consistent(dev->pdev, PAGE_SIZE,
(void *)dev_priv->hw_status_page, dev_priv->hw_status_page,
dev_priv->dma_status_page); dev_priv->dma_status_page);
/* Need to rewrite hardware status page */ /* Need to rewrite hardware status page */
I830_WRITE(0x02080, 0x1ffff000); I830_WRITE(0x02080, 0x1ffff000);
...@@ -434,16 +434,16 @@ static int i830_dma_initialize(drm_device_t *dev, ...@@ -434,16 +434,16 @@ static int i830_dma_initialize(drm_device_t *dev,
/* Program Hardware Status Page */ /* Program Hardware Status Page */
dev_priv->hw_status_page = dev_priv->hw_status_page =
(unsigned long) pci_alloc_consistent(dev->pdev, PAGE_SIZE, pci_alloc_consistent(dev->pdev, PAGE_SIZE,
&dev_priv->dma_status_page); &dev_priv->dma_status_page);
if(dev_priv->hw_status_page == 0UL) { if (!dev_priv->hw_status_page) {
dev->dev_private = (void *)dev_priv; dev->dev_private = (void *)dev_priv;
i830_dma_cleanup(dev); i830_dma_cleanup(dev);
DRM_ERROR("Can not allocate hardware status page\n"); DRM_ERROR("Can not allocate hardware status page\n");
return -ENOMEM; return -ENOMEM;
} }
memset((void *) dev_priv->hw_status_page, 0, PAGE_SIZE); memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
DRM_DEBUG("hw status page @ %lx\n", dev_priv->hw_status_page); DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
I830_WRITE(0x02080, dev_priv->dma_status_page); I830_WRITE(0x02080, dev_priv->dma_status_page);
DRM_DEBUG("Enabled hardware status page\n"); DRM_DEBUG("Enabled hardware status page\n");
...@@ -1335,7 +1335,7 @@ int i830_dma_vertex(struct inode *inode, struct file *filp, ...@@ -1335,7 +1335,7 @@ int i830_dma_vertex(struct inode *inode, struct file *filp,
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
drm_i830_vertex_t vertex; drm_i830_vertex_t vertex;
...@@ -1460,7 +1460,7 @@ int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd, ...@@ -1460,7 +1460,7 @@ int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
drm_file_t *priv = filp->private_data; drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
...@@ -1476,7 +1476,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd, ...@@ -1476,7 +1476,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
int retcode = 0; int retcode = 0;
drm_i830_dma_t d; drm_i830_dma_t d;
drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private;
u32 *hw_status = (u32 *)dev_priv->hw_status_page; u32 *hw_status = dev_priv->hw_status_page;
drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *) drm_i830_sarea_t *sarea_priv = (drm_i830_sarea_t *)
dev_priv->sarea_priv; dev_priv->sarea_priv;
......
...@@ -61,7 +61,7 @@ typedef struct drm_i830_private { ...@@ -61,7 +61,7 @@ typedef struct drm_i830_private {
drm_i830_sarea_t *sarea_priv; drm_i830_sarea_t *sarea_priv;
drm_i830_ring_buffer_t ring; drm_i830_ring_buffer_t ring;
unsigned long hw_status_page; void * hw_status_page;
unsigned long counter; unsigned long counter;
dma_addr_t dma_status_page; dma_addr_t dma_status_page;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment