Skip to contentSkip to conversation

removes casting of (void*) private structure members

PATCH In review Philipp Marek 2 participants 3 messages May 29, 2008 – May 30, 2008

Subsystems (38)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 removes casting of (void*) private structure members

Hello everybody,

here's another trivial patch, against v2.6.26-rc3-243-gd40ace0.

It's compile tested, but not entirely checkpatch-clean:
ERROR: code indent should use tabs where possible #3296: FILE: drivers/s390/net/lcs.c:1289:
+ card = dev->priv;$

ERROR: code indent should use tabs where possible #3363: FILE: drivers/s390/net/claw.c:1012:
+ privptr = dev->priv;$

ERROR: code indent should use tabs where possible #3372: FILE: drivers/s390/net/claw.c:1047:
+ privptr = dev->priv;$

ERROR: code indent should use tabs where possible #3540: FILE: drivers/s390/block/dasd_eckd.c:168:
+ private = device->private;$

total: 4 errors, 0 warnings, 4451 lines checked

I don't think it's a good idea to change the indent of single lines just because of this warnings, that's why I let them as-is.

The script can be downloaded from
http://kernelnewbies.org/KernelJanitors/Todo/VoidPointerConvs

diffstat | sort -k3 -n (and removed files with < 20 lines):
...
drivers/net/atarilance.c | 20 +++---

 net/atm/lec.c                                |   20 +++---
 drivers/net/ni52.c                           |   22 +++----
 drivers/net/3c523.c                          |   24 +++----
 drivers/net/mace.c                           |   24 +++----
 drivers/net/sun3_82586.c                     |   24 +++----
 drivers/net/ni65.c                           |   26 ++++----
 drivers/net/dm9000.c                         |   28 ++++-----
 drivers/s390/block/dasd_alias.c              |   28 ++++-----
 drivers/net/depca.c                          |   30 ++++-----
 drivers/message/i2o/i2o_proc.c               |   38 ++++++------
 drivers/s390/block/dasd_eckd.c               |   42 ++++++-------
 drivers/net/au1000_eth.c                     |   46 +++++++-------
 drivers/net/wan/sbni.c                       |   50 ++++++++--------
 drivers/net/wireless/zd1201.c                |   62 +++++++++----------
 drivers/net/wireless/wavelan.c               |   84 +++++++++++++--------------
 112 files changed, 553 insertions(+), 558 deletions(-)

There are some private structure variables that are not defined as (void*), (but int or long) and cannot be done without a cast; examples in

	drivers/char/hw_random/intel-rng.c
	drivers/crypto/hifn_795x.c
	drivers/mtd/mtdblock.c
	drivers/mtd/mtdoops.c
	drivers/mtd/rfd_ftl.c
	fs/jffs2/erase.c

Should these be converted to (void*), and an additional patch supplied?

Regards,

Phil

Signature · 2 lines
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!

---

Remove unneeded explicit casting from (void*) private structure members.

drivers/char/hw_random/geode-rng.c +2 -2
@@ -55,7 +55,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl);
 
 static int geode_rng_data_read(struct hwrng *rng, u32 *data)
 {
-	void __iomem *mem = (void __iomem *)rng->priv;
+	void __iomem *mem = rng->priv;
 
 	*data = readl(mem + GEODE_RNG_DATA_REG);
 
@@ -64,7 +64,7 @@ static int geode_rng_data_read(struct hw
 
 static int geode_rng_data_present(struct hwrng *rng, int wait)
 {
-	void __iomem *mem = (void __iomem *)rng->priv;
+	void __iomem *mem = rng->priv;
 	int data, i;
 
 	for (i = 0; i < 20; i++) {
drivers/char/hw_random/ixp4xx-rng.c +1 -1
@@ -28,7 +28,7 @@
 
 static int ixp4xx_rng_data_read(struct hwrng *rng, u32 *buffer)
 {
-	void __iomem * rng_base = (void __iomem *)rng->priv;
+	void __iomem *rng_base = rng->priv;
 
 	*buffer = __raw_readl(rng_base);
 
drivers/char/hw_random/pasemi-rng.c +4 -4
@@ -44,7 +44,7 @@
 
 static int pasemi_rng_data_present(struct hwrng *rng, int wait)
 {
-	void __iomem *rng_regs = (void __iomem *)rng->priv;
+	void __iomem *rng_regs = rng->priv;
 	int data, i;
 
 	for (i = 0; i < 20; i++) {
@@ -59,14 +59,14 @@ static int pasemi_rng_data_present(struc
 
 static int pasemi_rng_data_read(struct hwrng *rng, u32 *data)
 {
-	void __iomem *rng_regs = (void __iomem *)rng->priv;
+	void __iomem *rng_regs = rng->priv;
 	*data = in_le32(rng_regs + SDCRNG_VAL_REG);
 	return 4;
 }
 
 static int pasemi_rng_init(struct hwrng *rng)
 {
-	void __iomem *rng_regs = (void __iomem *)rng->priv;
+	void __iomem *rng_regs = rng->priv;
 	u32 ctl;
 
 	ctl = SDCRNG_CTL_DR | SDCRNG_CTL_SELECT_RRG_RNG | SDCRNG_CTL_KSZ;
@@ -78,7 +78,7 @@ static int pasemi_rng_init(struct hwrng 
 
 static void pasemi_rng_cleanup(struct hwrng *rng)
 {
-	void __iomem *rng_regs = (void __iomem *)rng->priv;
+	void __iomem *rng_regs = rng->priv;
 	u32 ctl;
 
 	ctl = SDCRNG_CTL_RE | SDCRNG_CTL_CE;
drivers/net/ni65.c +13 -13
@@ -295,7 +295,7 @@ static void ni65_set_performance(struct 
  */
 static int ni65_open(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	int irqval = request_irq(dev->irq, &ni65_interrupt,0,
                         cards[p->cardno].cardname,dev);
 	if (irqval) {
@@ -321,7 +321,7 @@ static int ni65_open(struct net_device *
  */
 static int ni65_close(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	netif_stop_queue(dev);
 
@@ -345,7 +345,7 @@ static int ni65_close(struct net_device 
 
 static void cleanup_card(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	disable_dma(dev->dma);
 	free_dma(dev->dma);
 	release_region(dev->base_addr, cards[p->cardno].total_size);
@@ -444,7 +444,7 @@ static int __init ni65_probe1(struct net
 		release_region(ioaddr, cards[i].total_size);
 		return j;
 	}
-	p = (struct priv *) dev->priv;
+	p = dev->priv;
 	p->cmdr_addr = ioaddr + cards[i].cmd_offset;
 	p->cardno = i;
 	spin_lock_init(&p->ring_lock);
@@ -790,7 +790,7 @@ static void ni65_stop_start(struct net_d
 static int ni65_lance_reinit(struct net_device *dev)
 {
 	 int i;
-	 struct priv *p = (struct priv *) dev->priv;
+	 struct priv *p = dev->priv;
 	 unsigned long flags;
 
 	 p->lock = 0;
@@ -876,7 +876,7 @@ static irqreturn_t ni65_interrupt(int ir
 	struct priv *p;
 	int bcnt = 32;
 
-	p = (struct priv *) dev->priv;
+	p = dev->priv;
 
 	spin_lock(&p->ring_lock);
 
@@ -899,7 +899,7 @@ static irqreturn_t ni65_interrupt(int ir
 
 		if(csr0 & CSR0_ERR)
 		{
-			struct priv *p = (struct priv *) dev->priv;
+			struct priv *p = dev->priv;
 			if(debuglevel > 1)
 				printk(KERN_ERR "%s: general error: %04x.\n",dev->name,csr0);
 			if(csr0 & CSR0_BABL)
@@ -924,7 +924,7 @@ static irqreturn_t ni65_interrupt(int ir
  int j;
  for(j=0;j<RMDNUM;j++)
  {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	int i,k,num1,num2;
 	for(i=RMDNUM-1;i>0;i--) {
 		 num2 = (p->rmdnum + i) & (RMDNUM-1);
@@ -982,7 +982,7 @@ static irqreturn_t ni65_interrupt(int ir
  */
 static void ni65_xmit_intr(struct net_device *dev,int csr0)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	while(p->xmit_queued)
 	{
@@ -1049,7 +1049,7 @@ static void ni65_recv_intr(struct net_de
 	struct rmd *rmdp;
 	int rmdstat,len;
 	int cnt=0;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	rmdp = p->rmdhead + p->rmdnum;
 	while(!( (rmdstat = rmdp->u.s.status) & RCV_OWN))
@@ -1140,7 +1140,7 @@ static void ni65_recv_intr(struct net_de
 static void ni65_timeout(struct net_device *dev)
 {
 	int i;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	printk(KERN_ERR "%s: xmitter timed out, try to restart!\n",dev->name);
 	for(i=0;i<TMDNUM;i++)
@@ -1157,7 +1157,7 @@ static void ni65_timeout(struct net_devi
 
 static int ni65_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	netif_stop_queue(dev);
 
@@ -1222,7 +1222,7 @@ static struct net_device_stats *ni65_get
 
 #if 0
 	int i;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	for(i=0;i<RMDNUM;i++)
 	{
 		struct rmd *rmdp = p->rmdhead + ((p->rmdnum + i) & (RMDNUM-1));
drivers/net/au1000_eth.c +23 -23

184 lines not on this page · raw message

drivers/net/wan/lmc/lmc_main.c +1 -1
@@ -1166,7 +1166,7 @@ static int lmc_open (struct net_device *
 static void lmc_running_reset (struct net_device *dev) /*fold00*/
 {
 
-    lmc_softc_t *sc = (lmc_softc_t *) dev->priv;
+    lmc_softc_t *sc = dev->priv;
 
     lmc_trace(dev, "lmc_runnig_reset in");
 
drivers/net/wan/cycx_x25.c +2 -2
@@ -1302,7 +1302,7 @@ static struct net_device *cycx_x25_get_d
 	struct cycx_x25_channel *chan;
 
 	while (dev) {
-		chan = (struct cycx_x25_channel*)dev->priv;
+		chan = dev->priv;
 
 		if (chan->lcn == lcn)
 			break;
@@ -1319,7 +1319,7 @@ static struct net_device *
 	struct cycx_x25_channel *chan;
 
 	while (dev) {
-		chan = (struct cycx_x25_channel*)dev->priv;
+		chan = dev->priv;
 
 		if (!strcmp(chan->addr, dte))
 			break;
drivers/net/wan/dlci.c +1 -1
@@ -391,7 +391,7 @@ static int dlci_add(struct dlci_add *dlc
 
 	*(short *)(master->dev_addr) = dlci->dlci;
 
-	dlp = (struct dlci_local *) master->priv;
+	dlp = master->priv;
 	dlp->slave = slave;
 	dlp->master = master;
 
drivers/net/wan/sbni.c +25 -25

189 lines not on this page · raw message

drivers/net/wan/pc300_drv.c +7 -7
@@ -1772,7 +1772,7 @@ cpc_trace(struct net_device *dev, struct
 
 static void cpc_tx_timeout(struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
 	struct net_device_stats *stats = hdlc_stats(dev);
@@ -1800,7 +1800,7 @@ static void cpc_tx_timeout(struct net_de
 
 static int cpc_queue_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
 	struct net_device_stats *stats = hdlc_stats(dev);
@@ -1883,7 +1883,7 @@ static int cpc_queue_xmit(struct sk_buff
 
 static void cpc_net_rx(struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
 	struct net_device_stats *stats = hdlc_stats(dev);
@@ -2533,7 +2533,7 @@ static int cpc_change_mtu(struct net_dev
 
 static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
 	pc300conf_t conf_aux;
@@ -3074,7 +3074,7 @@ static int tx_config(pc300dev_t * d)
 static int cpc_attach(struct net_device *dev, unsigned short encoding,
 		      unsigned short parity)
 {
-	pc300dev_t *d = (pc300dev_t *)dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *)d->chan;
 	pc300_t *card = (pc300_t *)chan->card;
 	pc300chconf_t *conf = (pc300chconf_t *)&chan->conf;
@@ -3154,7 +3154,7 @@ static void cpc_closech(pc300dev_t * d)
 
 int cpc_open(struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	struct ifreq ifr;
 	int result;
 
@@ -3191,7 +3191,7 @@ err_out:
 
 static int cpc_close(struct net_device *dev)
 {
-	pc300dev_t *d = (pc300dev_t *) dev->priv;
+	pc300dev_t *d = dev->priv;
 	pc300ch_t *chan = (pc300ch_t *) d->chan;
 	pc300_t *card = (pc300_t *) chan->card;
 	unsigned long flags;
drivers/net/lp486e.c +7 -7
@@ -390,7 +390,7 @@ i596_timeout(struct net_device *dev, cha
 	struct i596_private *lp;
 	int boguscnt = ct;
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	while (lp->scb.command) {
 		if (--boguscnt == 0) {
 			printk("%s: %s timed out - stat %4.4x, cmd %4.4x\n",
@@ -411,7 +411,7 @@ init_rx_bufs(struct net_device *dev, int
 	int i;
 	// struct i596_rbd *rbd;
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	lp->scb.pa_rfd = I596_NULL;
 
 	for (i = 0; i < num; i++) {
@@ -468,7 +468,7 @@ remove_rx_bufs(struct net_device *dev) {
 	struct i596_private *lp;
 	struct i596_rfd *rfd;
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	lp->rx_tail->pa_next = I596_NULL;
 
 	do {
@@ -622,7 +622,7 @@ init_i596(struct net_device *dev) {
 	if (i596_scp_setup(dev))
 		return 1;
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	lp->scb.command = 0;
 
 	memcpy ((void *)lp->i596_config, init_setup, 14);
@@ -705,7 +705,7 @@ i596_rx_one(struct net_device *dev, stru
 
 static int
 i596_rx(struct net_device *dev) {
-	struct i596_private *lp = (struct i596_private *) dev->priv;
+	struct i596_private *lp = dev->priv;
 	struct i596_rfd *rfd;
 	int frames = 0;
 
@@ -738,7 +738,7 @@ i596_cleanup_cmd(struct net_device *dev)
 	struct i596_private *lp;
 	struct i596_cmd *cmd;
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	while (lp->cmd_head) {
 		cmd = (struct i596_cmd *)lp->cmd_head;
 
@@ -970,7 +970,7 @@ static int __init lp486e_probe(struct ne
 		return -EBUSY;
 	}
 
-	lp = (struct i596_private *) dev->priv;
+	lp = dev->priv;
 	spin_lock_init(&lp->cmd_lock);
 
 	/*
drivers/net/ni52.c +11 -11
@@ -354,7 +354,7 @@ Enodev:
  */
 static void alloc586(struct net_device *dev)
 {
-	struct priv *p =	(struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	ni_reset586();
 	mdelay(32);
@@ -588,7 +588,7 @@ static int init586(struct net_device *de
 {
 	void __iomem *ptr;
 	int i, result = 0;
-	struct priv *p = (struct priv *)dev->priv;
+	struct priv *p = dev->priv;
 	struct configure_cmd_struct __iomem *cfg_cmd;
 	struct iasetup_cmd_struct __iomem *ias_cmd;
 	struct tdr_cmd_struct __iomem *tdr_cmd;
@@ -829,7 +829,7 @@ static void __iomem *alloc_rfa(struct ne
 	struct rfd_struct __iomem *rfd = ptr;
 	struct rbd_struct __iomem *rbd;
 	int i;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	memset_io(rfd, 0,
 		sizeof(struct rfd_struct) * (p->num_recv_buffs + rfdadd));
@@ -878,7 +878,7 @@ static irqreturn_t ni52_interrupt(int ir
 	int cnt = 0;
 	struct priv *p;
 
-	p = (struct priv *) dev->priv;
+	p = dev->priv;
 
 	if (debuglevel > 1)
 		printk("I");
@@ -950,7 +950,7 @@ static void ni52_rcv_int(struct net_devi
 	unsigned short totlen;
 	struct sk_buff *skb;
 	struct rbd_struct __iomem *rbd;
-	struct priv *p = (struct priv *)dev->priv;
+	struct priv *p = dev->priv;
 
 	if (debuglevel > 0)
 		printk("R");
@@ -1040,7 +1040,7 @@ static void ni52_rcv_int(struct net_devi
 
 static void ni52_rnr_int(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	p->stats.rx_errors++;
 
@@ -1065,7 +1065,7 @@ static void ni52_rnr_int(struct net_devi
 static void ni52_xmt_int(struct net_device *dev)
 {
 	int status;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	if (debuglevel > 0)
 		printk("X");
@@ -1113,7 +1113,7 @@ static void ni52_xmt_int(struct net_devi
 
 static void startrecv586(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	wait_for_scb_cmd(dev);
 	wait_for_scb_cmd_ruc(dev);
@@ -1126,7 +1126,7 @@ static void startrecv586(struct net_devi
 
 static void ni52_timeout(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 #ifndef NO_NOPCOMMANDS
 	if (readb(&p->scb->cus) & CU_ACTIVE) { /* COMMAND-UNIT active? */
 		netif_wake_queue(dev);
@@ -1177,7 +1177,7 @@ static int ni52_send_packet(struct sk_bu
 #ifndef NO_NOPCOMMANDS
 	int next_nop;
 #endif
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	if (skb->len > XMIT_BUFF_SIZE) {
 		printk(KERN_ERR "%s: Sorry, max. framelength is %d bytes. The length of your frame is %d bytes.\n", dev->name, XMIT_BUFF_SIZE, skb->len);
@@ -1274,7 +1274,7 @@ static int ni52_send_packet(struct sk_bu
 
 static struct net_device_stats *ni52_get_stats(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	unsigned short crc, aln, rsc, ovrn;
 
 	/* Get error-statistics from the ni82586 */
drivers/net/arcnet/capmode.c +3 -3
@@ -103,7 +103,7 @@ MODULE_LICENSE("GPL");
 static void rx(struct net_device *dev, int bufnum,
 	       struct archdr *pkthdr, int length)
 {
-	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+	struct arcnet_local *lp = dev->priv;
 	struct sk_buff *skb;
 	struct archdr *pkt = pkthdr;
 	char *pktbuf, *pkthdrbuf;
@@ -198,7 +198,7 @@ static int build_header(struct sk_buff *
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum)
 {
-	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+	struct arcnet_local *lp = dev->priv;
 	struct arc_hardware *hard = &pkt->hard;
 	int ofs;
 
@@ -250,7 +250,7 @@ static int prepare_tx(struct net_device 
 
 static int ack_tx(struct net_device *dev, int acked)
 {
-  struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+  struct arcnet_local *lp = dev->priv;
   struct sk_buff *ackskb;
   struct archdr *ackpkt;
   int length=sizeof(struct arc_cap);
drivers/net/arcnet/arcnet.c +1 -1
@@ -357,7 +357,7 @@ struct net_device *alloc_arcdev(char *na
 	dev = alloc_netdev(sizeof(struct arcnet_local),
 			   name && *name ? name : "arc%d", arcdev_setup);
 	if(dev) {
-		struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+		struct arcnet_local *lp = dev->priv;
 		spin_lock_init(&lp->lock);
 	}
 
drivers/net/wireless/wavelan_cs.c +5 -5
@@ -3895,7 +3895,7 @@ wv_hw_reset(struct net_device *	dev)
 static int
 wv_pcmcia_config(struct pcmcia_device *	link)
 {
-  struct net_device *	dev = (struct net_device *) link->priv;
+  struct net_device *	dev = link->priv;
   int			i;
   win_req_t		req;
   memreq_t		mem;
@@ -4013,7 +4013,7 @@ wv_pcmcia_config(struct pcmcia_device *	
 static void
 wv_pcmcia_release(struct pcmcia_device *link)
 {
-	struct net_device *	dev = (struct net_device *) link->priv;
+	struct net_device *	dev = link->priv;
 	net_local *		lp = netdev_priv(dev);
 
 #ifdef DEBUG_CONFIG_TRACE
@@ -4596,7 +4596,7 @@ wavelan_detach(struct pcmcia_device *lin
   /* Free pieces */
   if(link->priv)
     {
-      struct net_device *	dev = (struct net_device *) link->priv;
+      struct net_device *dev = link->priv;
 
       /* Remove ourselves from the kernel list of ethernet devices */
       /* Warning : can't be called from interrupt, timer or wavelan_close() */
@@ -4615,7 +4615,7 @@ wavelan_detach(struct pcmcia_device *lin
 
 static int wavelan_suspend(struct pcmcia_device *link)
 {
-	struct net_device *	dev = (struct net_device *) link->priv;
+	struct net_device *dev = link->priv;
 
 	/* NB: wavelan_close will be called, but too late, so we are
 	 * obliged to close nicely the wavelan here. David, could you
@@ -4637,7 +4637,7 @@ static int wavelan_suspend(struct pcmcia
 
 static int wavelan_resume(struct pcmcia_device *link)
 {
-	struct net_device *	dev = (struct net_device *) link->priv;
+	struct net_device *dev = link->priv;
 
 	if (link->open) {
 		wv_hw_reset(dev);
drivers/net/wireless/hostap/hostap_cs.c +2 -2
@@ -773,7 +773,7 @@ static void prism2_release(u_long arg)
 
 static int hostap_cs_suspend(struct pcmcia_device *link)
 {
-	struct net_device *dev = (struct net_device *) link->priv;
+	struct net_device *dev = link->priv;
 	int dev_open = 0;
 	struct hostap_interface *iface = NULL;
 
@@ -794,7 +794,7 @@ static int hostap_cs_suspend(struct pcmc
 
 static int hostap_cs_resume(struct pcmcia_device *link)
 {
-	struct net_device *dev = (struct net_device *) link->priv;
+	struct net_device *dev = link->priv;
 	int dev_open = 0;
 	struct hostap_interface *iface = NULL;
 
drivers/net/wireless/libertas/ethtool.c +2 -2
@@ -23,7 +23,7 @@ static const char * mesh_stat_strings[]=
 static void lbs_ethtool_get_drvinfo(struct net_device *dev,
 					 struct ethtool_drvinfo *info)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 
 	snprintf(info->fw_version, 32, "%u.%u.%u.p%u",
 		priv->fwrelease >> 24 & 0xff,
@@ -47,7 +47,7 @@ static int lbs_ethtool_get_eeprom_len(st
 static int lbs_ethtool_get_eeprom(struct net_device *dev,
                                   struct ethtool_eeprom *eeprom, u8 * bytes)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 	struct cmd_ds_802_11_eeprom_access cmd;
 	int ret;
 
drivers/net/wireless/libertas/if_usb.c +1 -1
@@ -264,7 +264,7 @@ error:
 static void if_usb_disconnect(struct usb_interface *intf)
 {
 	struct if_usb_card *cardp = usb_get_intfdata(intf);
-	struct lbs_private *priv = (struct lbs_private *) cardp->priv;
+	struct lbs_private *priv = cardp->priv;
 
 	lbs_deb_enter(LBS_DEB_MAIN);
 
drivers/net/wireless/libertas/main.c +5 -5
@@ -391,7 +391,7 @@ static struct attribute_group lbs_mesh_a
  */
 static int lbs_dev_open(struct net_device *dev)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv ;
+	struct lbs_private *priv = dev->priv ;
 	int ret = 0;
 
 	lbs_deb_enter(LBS_DEB_NET);
@@ -458,7 +458,7 @@ static int lbs_mesh_stop(struct net_devi
  */
 static int lbs_eth_stop(struct net_device *dev)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 
 	lbs_deb_enter(LBS_DEB_NET);
 
@@ -473,7 +473,7 @@ static int lbs_eth_stop(struct net_devic
 
 static void lbs_tx_timeout(struct net_device *dev)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 
 	lbs_deb_enter(LBS_DEB_TX);
 
@@ -525,7 +525,7 @@ EXPORT_SYMBOL_GPL(lbs_host_to_card_done)
  */
 static struct net_device_stats *lbs_get_stats(struct net_device *dev)
 {
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 
 	lbs_deb_enter(LBS_DEB_NET);
 	return &priv->stats;
@@ -534,7 +534,7 @@ static struct net_device_stats *lbs_get_
 static int lbs_set_mac_address(struct net_device *dev, void *addr)
 {
 	int ret = 0;
-	struct lbs_private *priv = (struct lbs_private *) dev->priv;
+	struct lbs_private *priv = dev->priv;
 	struct sockaddr *phwaddr = addr;
 	struct cmd_ds_802_11_mac_address cmd;
 
drivers/net/wireless/airo.c +1 -1
@@ -7527,7 +7527,7 @@ static const struct iw_handler_def	airo_
 static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
 	int rc = 0;
-	struct airo_info *ai = (struct airo_info *)dev->priv;
+	struct airo_info *ai = dev->priv;
 
 	if (ai->power.event)
 		return 0;
drivers/net/wireless/ray_cs.c +2 -2
@@ -412,7 +412,7 @@ static int ray_config(struct pcmcia_devi
     int i;
     win_req_t req;
     memreq_t mem;
-    struct net_device *dev = (struct net_device *)link->priv;
+    struct net_device *dev = link->priv;
     ray_dev_t *local = netdev_priv(dev);
     DECLARE_MAC_BUF(mac);
 
@@ -2600,7 +2600,7 @@ static int ray_cs_proc_show(struct seq_f
     link = this_device;
     if (!link)
     	return 0;
-    dev = (struct net_device *)link->priv;
+    dev = link->priv;
     if (!dev)
     	return 0;
     local = netdev_priv(dev);
drivers/net/wireless/zd1201.c +31 -31

248 lines not on this page · raw message

drivers/net/wireless/wavelan.c +42 -42

336 lines not on this page · raw message

drivers/net/netxen/netxen_nic_main.c +1 -1
@@ -834,7 +834,7 @@ static void __devexit netxen_nic_remove(
  */
 static int netxen_nic_open(struct net_device *netdev)
 {
-	struct netxen_adapter *adapter = (struct netxen_adapter *)netdev->priv;
+	struct netxen_adapter *adapter = netdev->priv;
 	int err = 0;
 	int ctx, ring;
 	irq_handler_t handler;
drivers/net/gianfar_mii.c +3 -3
@@ -103,7 +103,7 @@ int gfar_local_mdio_read(struct gfar_mii
  * All PHY configuration is done through the TSEC1 MIIM regs */
 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
 {
-	struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+	struct gfar_mii __iomem *regs = bus->priv;
 
 	/* Write to the local MII regs */
 	return(gfar_local_mdio_write(regs, mii_id, regnum, value));
@@ -114,7 +114,7 @@ int gfar_mdio_write(struct mii_bus *bus,
  * configuration has to be done through the TSEC1 MIIM regs */
 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
 {
-	struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+	struct gfar_mii __iomem *regs = bus->priv;
 
 	/* Read the local MII regs */
 	return(gfar_local_mdio_read(regs, mii_id, regnum));
@@ -123,7 +123,7 @@ int gfar_mdio_read(struct mii_bus *bus, 
 /* Reset the MIIM registers, and wait for the bus to free */
 static int gfar_mdio_reset(struct mii_bus *bus)
 {
-	struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
+	struct gfar_mii __iomem *regs = bus->priv;
 	unsigned int timeout = PHY_INIT_TIMEOUT;
 
 	mutex_lock(&bus->mdio_lock);
drivers/net/declance.c +1 -1
@@ -1039,7 +1039,7 @@ static int __init dec_lance_probe(struct
 		dev = root_lance_dev;
 		while (dev) {
 			i++;
-			lp = (struct lance_private *)dev->priv;
+			lp = dev->priv;
 			dev = lp->next;
 		}
 		snprintf(name, sizeof(name), fmt, i);
drivers/net/sfc/falcon.c +2 -2
@@ -1940,7 +1940,7 @@ static int falcon_gmii_wait(struct efx_n
 static void falcon_mdio_write(struct net_device *net_dev, int phy_id,
 			      int addr, int value)
 {
-	struct efx_nic *efx = (struct efx_nic *)net_dev->priv;
+	struct efx_nic *efx = net_dev->priv;
 	unsigned int phy_id2 = phy_id & FALCON_PHY_ID_ID_MASK;
 	efx_oword_t reg;
 
@@ -2008,7 +2008,7 @@ static void falcon_mdio_write(struct net
  * could be read, -1 will be returned. */
 static int falcon_mdio_read(struct net_device *net_dev, int phy_id, int addr)
 {
-	struct efx_nic *efx = (struct efx_nic *)net_dev->priv;
+	struct efx_nic *efx = net_dev->priv;
 	unsigned int phy_addr = phy_id & FALCON_PHY_ID_ID_MASK;
 	efx_oword_t reg;
 	int value = -1;
drivers/net/mace.c +12 -12
@@ -165,7 +165,7 @@ static int __devinit mace_probe(struct m
 			in_8(&mp->mace->chipid_lo);
 
 
-	mp = (struct mace_data *) dev->priv;
+	mp = dev->priv;
 	mp->maccc = ENXMT | ENRCV;
 
 	mp->tx_dma = ioremap(macio_resource_start(mdev, 1), 0x1000);
@@ -312,7 +312,7 @@ static void dbdma_reset(volatile struct 
 
 static void mace_reset(struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     int i;
 
@@ -367,7 +367,7 @@ static void mace_reset(struct net_device
 
 static void __mace_set_address(struct net_device *dev, void *addr)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     unsigned char *p = addr;
     int i;
@@ -388,7 +388,7 @@ static void __mace_set_address(struct ne
 
 static int mace_set_address(struct net_device *dev, void *addr)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     unsigned long flags;
 
@@ -423,7 +423,7 @@ static inline void mace_clean_rings(stru
 
 static int mace_open(struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
     volatile struct dbdma_regs __iomem *td = mp->tx_dma;
@@ -493,7 +493,7 @@ static int mace_open(struct net_device *
 
 static int mace_close(struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
     volatile struct dbdma_regs __iomem *td = mp->tx_dma;
@@ -513,7 +513,7 @@ static int mace_close(struct net_device 
 
 static inline void mace_set_timeout(struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
 
     if (mp->timeout_active)
 	del_timer(&mp->tx_timeout);
@@ -526,7 +526,7 @@ static inline void mace_set_timeout(stru
 
 static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct dbdma_regs __iomem *td = mp->tx_dma;
     volatile struct dbdma_cmd *cp, *np;
     unsigned long flags;
@@ -581,7 +581,7 @@ static int mace_xmit_start(struct sk_buf
 
 static void mace_set_multicast(struct net_device *dev)
 {
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     int i, j;
     u32 crc;
@@ -656,7 +656,7 @@ static void mace_handle_misc_intrs(struc
 static irqreturn_t mace_interrupt(int irq, void *dev_id)
 {
     struct net_device *dev = (struct net_device *) dev_id;
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     volatile struct dbdma_regs __iomem *td = mp->tx_dma;
     volatile struct dbdma_cmd *cp;
@@ -802,7 +802,7 @@ static irqreturn_t mace_interrupt(int ir
 static void mace_tx_timeout(unsigned long data)
 {
     struct net_device *dev = (struct net_device *) data;
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct mace __iomem *mb = mp->mace;
     volatile struct dbdma_regs __iomem *td = mp->tx_dma;
     volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
@@ -873,7 +873,7 @@ static irqreturn_t mace_txdma_intr(int i
 static irqreturn_t mace_rxdma_intr(int irq, void *dev_id)
 {
     struct net_device *dev = (struct net_device *) dev_id;
-    struct mace_data *mp = (struct mace_data *) dev->priv;
+    struct mace_data *mp = dev->priv;
     volatile struct dbdma_regs __iomem *rd = mp->rx_dma;
     volatile struct dbdma_cmd *cp, *np;
     int i, nb, stat, next;
drivers/net/sun3_82586.c +12 -12
@@ -247,7 +247,7 @@ static int check586(struct net_device *d
  */
 static void alloc586(struct net_device *dev)
 {
-	struct priv *p =	(struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	sun3_reset586();
 	DELAY(1);
@@ -397,7 +397,7 @@ static int init586(struct net_device *de
 {
 	void *ptr;
 	int i,result=0;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	volatile struct configure_cmd_struct	*cfg_cmd;
 	volatile struct iasetup_cmd_struct *ias_cmd;
 	volatile struct tdr_cmd_struct *tdr_cmd;
@@ -634,7 +634,7 @@ static void *alloc_rfa(struct net_device
 	volatile struct rfd_struct *rfd = (struct rfd_struct *)ptr;
 	volatile struct rbd_struct *rbd;
 	int i;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	memset((char *) rfd,0,sizeof(struct rfd_struct)*(p->num_recv_buffs+rfdadd));
 	p->rfd_first = rfd;
@@ -686,7 +686,7 @@ static irqreturn_t sun3_82586_interrupt(
 		printk ("sun3_82586-interrupt: irq %d for unknown device.\n",irq);
 		return IRQ_NONE;
 	}
-	p = (struct priv *) dev->priv;
+	p = dev->priv;
 
 	if(debuglevel > 1)
 		printk("I");
@@ -756,7 +756,7 @@ static void sun3_82586_rcv_int(struct ne
 	unsigned short totlen;
 	struct sk_buff *skb;
 	struct rbd_struct *rbd;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	if(debuglevel > 0)
 		printk("R");
@@ -874,7 +874,7 @@ static void sun3_82586_rcv_int(struct ne
 
 static void sun3_82586_rnr_int(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	p->stats.rx_errors++;
 
@@ -898,7 +898,7 @@ static void sun3_82586_rnr_int(struct ne
 static void sun3_82586_xmt_int(struct net_device *dev)
 {
 	int status;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	if(debuglevel > 0)
 		printk("X");
@@ -948,7 +948,7 @@ static void sun3_82586_xmt_int(struct ne
 
 static void startrecv586(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	WAIT_4_SCB_CMD();
 	WAIT_4_SCB_CMD_RUC();
@@ -960,7 +960,7 @@ static void startrecv586(struct net_devi
 
 static void sun3_82586_timeout(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 #ifndef NO_NOPCOMMANDS
 	if(p->scb->cus & CU_ACTIVE) /* COMMAND-UNIT active? */
 	{
@@ -1002,7 +1002,7 @@ static int sun3_82586_send_packet(struct
 #ifndef NO_NOPCOMMANDS
 	int next_nop;
 #endif
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	if(skb->len > XMIT_BUFF_SIZE)
 	{
@@ -1111,7 +1111,7 @@ static int sun3_82586_send_packet(struct
 
 static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	unsigned short crc,aln,rsc,ovrn;
 
 	crc = swab16(p->scb->crc_errs); /* get error-statistic from the ni82586 */
@@ -1174,7 +1174,7 @@ void cleanup_module(void)
  */
 void sun3_82586_dump(struct net_device *dev,void *ptr)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	struct dump_cmd_struct *dump_cmd = (struct dump_cmd_struct *) ptr;
 	int i;
 
drivers/net/iseries_veth.c +7 -7
@@ -952,7 +952,7 @@ static int veth_change_mtu(struct net_de
 
 static void veth_set_multicast_list(struct net_device *dev)
 {
-	struct veth_port *port = (struct veth_port *) dev->priv;
+	struct veth_port *port = dev->priv;
 	unsigned long flags;
 
 	write_lock_irqsave(&port->mcast_gate, flags);
@@ -1044,7 +1044,7 @@ static struct net_device *veth_probe_one
 		return NULL;
 	}
 
-	port = (struct veth_port *) dev->priv;
+	port = dev->priv;
 
 	spin_lock_init(&port->queue_lock);
 	rwlock_init(&port->mcast_gate);
@@ -1102,7 +1102,7 @@ static int veth_transmit_to_one(struct s
 				struct net_device *dev)
 {
 	struct veth_lpar_connection *cnx = veth_cnx[rlp];
-	struct veth_port *port = (struct veth_port *) dev->priv;
+	struct veth_port *port = dev->priv;
 	HvLpEvent_Rc rc;
 	struct veth_msg *msg = NULL;
 	unsigned long flags;
@@ -1191,7 +1191,7 @@ static void veth_transmit_to_many(struct
 static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned char *frame = skb->data;
-	struct veth_port *port = (struct veth_port *) dev->priv;
+	struct veth_port *port = dev->priv;
 	HvLpIndexMap lpmask;
 
 	if (! (frame[0] & 0x01)) {
@@ -1255,7 +1255,7 @@ static void veth_wake_queues(struct veth
 		if (! dev)
 			continue;
 
-		port = (struct veth_port *)dev->priv;
+		port = dev->priv;
 
 		if (! (port->lpar_map & (1<<cnx->remote_lp)))
 			continue;
@@ -1284,7 +1284,7 @@ static void veth_stop_queues(struct veth
 		if (! dev)
 			continue;
 
-		port = (struct veth_port *)dev->priv;
+		port = dev->priv;
 
 		/* If this cnx is not on the vlan for this port, continue */
 		if (! (port->lpar_map & (1 << cnx->remote_lp)))
@@ -1506,7 +1506,7 @@ static void veth_receive(struct veth_lpa
 			continue;
 		}
 
-		port = (struct veth_port *)dev->priv;
+		port = dev->priv;
 		dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000;
 
 		if ((vlan > HVMAXARCHITECTEDVIRTUALLANS) || !port) {
drivers/net/ppp_generic.c +1 -1
@@ -875,7 +875,7 @@ out_chrdev:
 static int
 ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct ppp *ppp = (struct ppp *) dev->priv;
+	struct ppp *ppp = dev->priv;
 	int npi, proto;
 	unsigned char *pp;
 
drivers/net/sb1250-mac.c +2 -2
@@ -456,7 +456,7 @@ static void sbmac_mii_senddata(void __io
 
 static int sbmac_mii_read(struct mii_bus *bus, int phyaddr, int regidx)
 {
-	struct sbmac_softc *sc = (struct sbmac_softc *)bus->priv;
+	struct sbmac_softc *sc = bus->priv;
 	void __iomem *sbm_mdio = sc->sbm_mdio;
 	int idx;
 	int error;
@@ -550,7 +550,7 @@ static int sbmac_mii_read(struct mii_bus
 static int sbmac_mii_write(struct mii_bus *bus, int phyaddr, int regidx,
 			   u16 regval)
 {
-	struct sbmac_softc *sc = (struct sbmac_softc *)bus->priv;
+	struct sbmac_softc *sc = bus->priv;
 	void __iomem *sbm_mdio = sc->sbm_mdio;
 	int mac_mdio_genc;
 
drivers/net/depca.c +15 -15
@@ -601,7 +601,7 @@ static int __init depca_hw_init (struct 
 		return -ENXIO;
 	}
 
-	lp = (struct depca_private *) dev->priv;
+	lp = dev->priv;
 	mem_start = lp->mem_start;
 
 	if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown)
@@ -821,7 +821,7 @@ out_priv:
 
 static int depca_open(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 	s16 nicsr;
 	int status = 0;
@@ -866,7 +866,7 @@ static int depca_open(struct net_device 
 /* Initialize the lance Rx and Tx descriptor rings. */
 static void depca_init_ring(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_int i;
 	u_long offset;
 
@@ -924,7 +924,7 @@ static void depca_tx_timeout(struct net_
 */
 static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 	int status = 0;
 
@@ -972,7 +972,7 @@ static irqreturn_t depca_interrupt(int i
 		return IRQ_NONE;
 	}
 
-	lp = (struct depca_private *) dev->priv;
+	lp = dev->priv;
 	ioaddr = dev->base_addr;
 
 	spin_lock(&lp->lock);
@@ -1010,7 +1010,7 @@ static irqreturn_t depca_interrupt(int i
 /* Called with lp->lock held */
 static int depca_rx(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	int i, entry;
 	s32 status;
 
@@ -1108,7 +1108,7 @@ static int depca_rx(struct net_device *d
 */
 static int depca_tx(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	int entry;
 	s32 status;
 	u_long ioaddr = dev->base_addr;
@@ -1149,7 +1149,7 @@ static int depca_tx(struct net_device *d
 
 static int depca_close(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	s16 nicsr;
 	u_long ioaddr = dev->base_addr;
 
@@ -1185,7 +1185,7 @@ static int depca_close(struct net_device
 
 static void LoadCSRs(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 
 	outw(CSR1, DEPCA_ADDR);	/* initialisation block address LSW */
@@ -1202,7 +1202,7 @@ static void LoadCSRs(struct net_device *
 
 static int InitRestartDepca(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 	int i, status = 0;
 
@@ -1234,7 +1234,7 @@ static int InitRestartDepca(struct net_d
 */
 static void set_multicast_list(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 
 	netif_stop_queue(dev);
@@ -1263,7 +1263,7 @@ static void set_multicast_list(struct ne
 */
 static void SetMulticastFilter(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	struct dev_mc_list *dmi = dev->mc_list;
 	char *addrs;
 	int i, j, bit, byte;
@@ -1782,7 +1782,7 @@ static int __init get_hw_addr(struct net
 */
 static int load_packet(struct net_device *dev, struct sk_buff *skb)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	int i, entry, end, len, status = 0;
 
 	entry = lp->tx_new;	/* Ring around buffer number. */
@@ -1837,7 +1837,7 @@ static int load_packet(struct net_device
 
 static void depca_dbg_open(struct net_device *dev)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	u_long ioaddr = dev->base_addr;
 	struct depca_init *p = &lp->init_block;
 	int i;
@@ -1909,7 +1909,7 @@ static void depca_dbg_open(struct net_de
 */
 static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-	struct depca_private *lp = (struct depca_private *) dev->priv;
+	struct depca_private *lp = dev->priv;
 	struct depca_ioctl *ioc = (struct depca_ioctl *) &rq->ifr_ifru;
 	int i, status = 0;
 	u_long ioaddr = dev->base_addr;
drivers/net/eepro.c +2 -2
@@ -605,7 +605,7 @@ out:
 
 static void __init printEEPROMInfo(struct net_device *dev)
 {
-	struct eepro_local *lp = (struct eepro_local *)dev->priv;
+	struct eepro_local *lp = dev->priv;
 	int ioaddr = dev->base_addr;
 	unsigned short Word;
 	int i,j;
@@ -1684,7 +1684,7 @@ eepro_transmit_interrupt(struct net_devi
 static int eepro_ethtool_get_settings(struct net_device *dev,
 					struct ethtool_cmd *cmd)
 {
-	struct eepro_local	*lp = (struct eepro_local *)dev->priv;
+	struct eepro_local	*lp = dev->priv;
 
 	cmd->supported = 	SUPPORTED_10baseT_Half |
 				SUPPORTED_10baseT_Full |
drivers/net/ucc_geth_mii.c +3 -3
@@ -61,7 +61,7 @@
 /* configuration has to be done through the master UEC MIIM regs */
 int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value)
 {
-	struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv;
+	struct ucc_mii_mng __iomem *regs = bus->priv;
 
 	/* Setting up the MII Mangement Address Register */
 	out_be32(&regs->miimadd,
@@ -82,7 +82,7 @@ int uec_mdio_write(struct mii_bus *bus, 
 /* configuration has to be done through the TSEC1 MIIM regs */
 int uec_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
 {
-	struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv;
+	struct ucc_mii_mng __iomem *regs = bus->priv;
 	u16 value;
 
 	/* Setting up the MII Mangement Address Register */
@@ -106,7 +106,7 @@ int uec_mdio_read(struct mii_bus *bus, i
 /* Reset the MIIM registers, and wait for the bus to free */
 static int uec_mdio_reset(struct mii_bus *bus)
 {
-	struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv;
+	struct ucc_mii_mng __iomem *regs = bus->priv;
 	unsigned int timeout = PHY_INIT_TIMEOUT;
 
 	mutex_lock(&bus->mdio_lock);
drivers/net/myri_sbus.c +6 -6
@@ -532,7 +532,7 @@ static void myri_rx(struct myri_eth *mp,
 static irqreturn_t myri_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev		= (struct net_device *) dev_id;
-	struct myri_eth *mp		= (struct myri_eth *) dev->priv;
+	struct myri_eth *mp		= dev->priv;
 	void __iomem *lregs		= mp->lregs;
 	struct myri_channel __iomem *chan = &mp->shmem->channel;
 	unsigned long flags;
@@ -571,14 +571,14 @@ static irqreturn_t myri_interrupt(int ir
 
 static int myri_open(struct net_device *dev)
 {
-	struct myri_eth *mp = (struct myri_eth *) dev->priv;
+	struct myri_eth *mp = dev->priv;
 
 	return myri_init(mp, in_interrupt());
 }
 
 static int myri_close(struct net_device *dev)
 {
-	struct myri_eth *mp = (struct myri_eth *) dev->priv;
+	struct myri_eth *mp = dev->priv;
 
 	myri_clean_rings(mp);
 	return 0;
@@ -586,7 +586,7 @@ static int myri_close(struct net_device 
 
 static void myri_tx_timeout(struct net_device *dev)
 {
-	struct myri_eth *mp = (struct myri_eth *) dev->priv;
+	struct myri_eth *mp = dev->priv;
 
 	printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
 
@@ -597,7 +597,7 @@ static void myri_tx_timeout(struct net_d
 
 static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct myri_eth *mp = (struct myri_eth *) dev->priv;
+	struct myri_eth *mp = dev->priv;
 	struct sendq __iomem *sq = mp->sq;
 	struct myri_txd __iomem *txd;
 	unsigned long flags;
@@ -912,7 +912,7 @@ static int __devinit myri_ether_init(str
 
 	SET_NETDEV_DEV(dev, &sdev->ofdev.dev);
 
-	mp = (struct myri_eth *) dev->priv;
+	mp = dev->priv;
 	spin_lock_init(&mp->irq_lock);
 	mp->myri_sdev = sdev;
 
drivers/net/lance.c +1 -1
@@ -910,7 +910,7 @@ lance_restart(struct net_device *dev, un
 
 static void lance_tx_timeout (struct net_device *dev)
 {
-	struct lance_private *lp = (struct lance_private *) dev->priv;
+	struct lance_private *lp = dev->priv;
 	int ioaddr = dev->base_addr;
 
 	outw (0, ioaddr + LANCE_ADDR);
drivers/net/mvme147.c +1 -1
@@ -106,7 +106,7 @@ struct net_device * __init mvme147lance_
 	       dev->name, dev->base_addr, MVME147_LANCE_IRQ,
 	       print_mac(mac, dev->dev_addr));
 
-	lp = (struct m147lance_private *)dev->priv;
+	lp = dev->priv;
 	lp->ram = __get_dma_pages(GFP_ATOMIC, 3);	/* 16K */
 	if (!lp->ram)
 	{
drivers/net/irda/via-ircc.c +5 -5
@@ -824,7 +824,7 @@ static int via_ircc_hard_xmit_sir(struct
 	u16 iobase;
 	__u32 speed;
 
-	self = (struct via_ircc_cb *) dev->priv;
+	self = dev->priv;
 	IRDA_ASSERT(self != NULL, return 0;);
 	iobase = self->io.fir_base;
 
@@ -896,7 +896,7 @@ static int via_ircc_hard_xmit_fir(struct
 	__u32 speed;
 	unsigned long flags;
 
-	self = (struct via_ircc_cb *) dev->priv;
+	self = dev->priv;
 	iobase = self->io.fir_base;
 
 	if (self->st_fifo.len)
@@ -1522,7 +1522,7 @@ static int via_ircc_net_open(struct net_
 	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct via_ircc_cb *) dev->priv;
+	self = dev->priv;
 	self->stats.rx_packets = 0;
 	IRDA_ASSERT(self != NULL, return 0;);
 	iobase = self->io.fir_base;
@@ -1588,7 +1588,7 @@ static int via_ircc_net_close(struct net
 	IRDA_DEBUG(3, "%s()\n", __FUNCTION__);
 
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct via_ircc_cb *) dev->priv;
+	self = dev->priv;
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	/* Stop device */
@@ -1660,7 +1660,7 @@ static int via_ircc_net_ioctl(struct net
 static struct net_device_stats *via_ircc_net_get_stats(struct net_device
 						       *dev)
 {
-	struct via_ircc_cb *self = (struct via_ircc_cb *) dev->priv;
+	struct via_ircc_cb *self = dev->priv;
 
 	return &self->stats;
 }
drivers/net/irda/nsc-ircc.c +5 -5
@@ -1350,7 +1350,7 @@ static int nsc_ircc_hard_xmit_sir(struct
 	__s32 speed;
 	__u8 bank;
 	
-	self = (struct nsc_ircc_cb *) dev->priv;
+	self = dev->priv;
 
 	IRDA_ASSERT(self != NULL, return 0;);
 
@@ -1423,7 +1423,7 @@ static int nsc_ircc_hard_xmit_fir(struct
 	__u8 bank;
 	int mtt, diff;
 	
-	self = (struct nsc_ircc_cb *) dev->priv;
+	self = dev->priv;
 	iobase = self->io.fir_base;
 
 	netif_stop_queue(dev);
@@ -2162,7 +2162,7 @@ static int nsc_ircc_net_open(struct net_
 	IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
 	
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct nsc_ircc_cb *) dev->priv;
+	self = dev->priv;
 	
 	IRDA_ASSERT(self != NULL, return 0;);
 	
@@ -2225,7 +2225,7 @@ static int nsc_ircc_net_close(struct net
 	
 	IRDA_ASSERT(dev != NULL, return -1;);
 
-	self = (struct nsc_ircc_cb *) dev->priv;
+	self = dev->priv;
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	/* Stop device */
@@ -2306,7 +2306,7 @@ static int nsc_ircc_net_ioctl(struct net
 
 static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev)
 {
-	struct nsc_ircc_cb *self = (struct nsc_ircc_cb *) dev->priv;
+	struct nsc_ircc_cb *self = dev->priv;
 	
 	return &self->stats;
 }
drivers/net/irda/w83977af_ir.c +4 -4
@@ -497,7 +497,7 @@ int w83977af_hard_xmit(struct sk_buff *s
 	__u8 set;
 	int mtt;
 	
-	self = (struct w83977af_ir *) dev->priv;
+	self = dev->priv;
 
 	iobase = self->io.fir_base;
 
@@ -1192,7 +1192,7 @@ static int w83977af_net_open(struct net_
 	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
 	
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct w83977af_ir *) dev->priv;
+	self = dev->priv;
 	
 	IRDA_ASSERT(self != NULL, return 0;);
 	
@@ -1256,7 +1256,7 @@ static int w83977af_net_close(struct net
 
 	IRDA_ASSERT(dev != NULL, return -1;);
 	
-	self = (struct w83977af_ir *) dev->priv;
+	self = dev->priv;
 	
 	IRDA_ASSERT(self != NULL, return 0;);
 	
@@ -1339,7 +1339,7 @@ out:
 
 static struct net_device_stats *w83977af_net_get_stats(struct net_device *dev)
 {
-	struct w83977af_ir *self = (struct w83977af_ir *) dev->priv;
+	struct w83977af_ir *self = dev->priv;
 	
 	return &self->stats;
 }
drivers/net/irda/irda-usb.c +2 -2
@@ -1175,7 +1175,7 @@ static int irda_usb_net_open(struct net_
 	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	IRDA_ASSERT(netdev != NULL, return -1;);
-	self = (struct irda_usb_cb *) netdev->priv;
+	self = netdev->priv;
 	IRDA_ASSERT(self != NULL, return -1;);
 
 	spin_lock_irqsave(&self->lock, flags);
@@ -1257,7 +1257,7 @@ static int irda_usb_net_close(struct net
 	IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
 
 	IRDA_ASSERT(netdev != NULL, return -1;);
-	self = (struct irda_usb_cb *) netdev->priv;
+	self = netdev->priv;
 	IRDA_ASSERT(self != NULL, return -1;);
 
 	/* Clear this flag *before* unlinking the urbs and *before*
drivers/net/irda/donauboe.c +2 -2
@@ -983,7 +983,7 @@ toshoboe_hard_xmit (struct sk_buff *skb,
   unsigned long flags;
   struct irda_skb_cb *cb = (struct irda_skb_cb *) skb->cb;
 
-  self = (struct toshoboe_cb *) dev->priv;
+  self = dev->priv;
 
   IRDA_ASSERT (self != NULL, return 0; );
 
@@ -1388,7 +1388,7 @@ toshoboe_net_close (struct net_device *d
   IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
 
   IRDA_ASSERT (dev != NULL, return -1; );
-  self = (struct toshoboe_cb *) dev->priv;
+  self = dev->priv;
 
   /* Stop device */
   netif_stop_queue(dev);
drivers/net/irda/ali-ircc.c +5 -5
@@ -1333,7 +1333,7 @@ static int ali_ircc_net_open(struct net_
 	
 	IRDA_ASSERT(dev != NULL, return -1;);
 	
-	self = (struct ali_ircc_cb *) dev->priv;
+	self = dev->priv;
 	
 	IRDA_ASSERT(self != NULL, return 0;);
 	
@@ -1396,7 +1396,7 @@ static int ali_ircc_net_close(struct net
 		
 	IRDA_ASSERT(dev != NULL, return -1;);
 
-	self = (struct ali_ircc_cb *) dev->priv;
+	self = dev->priv;
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	/* Stop device */
@@ -1436,7 +1436,7 @@ static int ali_ircc_fir_hard_xmit(struct
 	
 	IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ );	
 	
-	self = (struct ali_ircc_cb *) dev->priv;
+	self = dev->priv;
 	iobase = self->io.fir_base;
 
 	netif_stop_queue(dev);
@@ -1960,7 +1960,7 @@ static int ali_ircc_sir_hard_xmit(struct
 	
 	IRDA_ASSERT(dev != NULL, return 0;);
 	
-	self = (struct ali_ircc_cb *) dev->priv;
+	self = dev->priv;
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	iobase = self->io.sir_base;
@@ -2114,7 +2114,7 @@ static int ali_ircc_is_receiving(struct 
 
 static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev)
 {
-	struct ali_ircc_cb *self = (struct ali_ircc_cb *) dev->priv;
+	struct ali_ircc_cb *self = dev->priv;
 	
 	IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
 		
drivers/net/sgiseeq.c +1 -1
@@ -657,7 +657,7 @@ static void timeout(struct net_device *d
 
 static void sgiseeq_set_multicast(struct net_device *dev)
 {
-	struct sgiseeq_private *sp = (struct sgiseeq_private *) dev->priv;
+	struct sgiseeq_private *sp = dev->priv;
 	unsigned char oldmode = sp->mode;
 
 	if(dev->flags & IFF_PROMISC)
drivers/net/hamradio/scc.c +5 -5
@@ -1574,7 +1574,7 @@ static void scc_net_setup(struct net_dev
 
 static int scc_net_open(struct net_device *dev)
 {
-	struct scc_channel *scc = (struct scc_channel *) dev->priv;
+	struct scc_channel *scc = dev->priv;
 
  	if (!scc->init)
 		return -EINVAL;
@@ -1592,7 +1592,7 @@ static int scc_net_open(struct net_devic
 
 static int scc_net_close(struct net_device *dev)
 {
-	struct scc_channel *scc = (struct scc_channel *) dev->priv;
+	struct scc_channel *scc = dev->priv;
 	unsigned long flags;
 
 	netif_stop_queue(dev);
@@ -1634,7 +1634,7 @@ static void scc_net_rx(struct scc_channe
 
 static int scc_net_tx(struct sk_buff *skb, struct net_device *dev)
 {
-	struct scc_channel *scc = (struct scc_channel *) dev->priv;
+	struct scc_channel *scc = dev->priv;
 	unsigned long flags;
 	char kisscmd;
 
@@ -1704,7 +1704,7 @@ static int scc_net_ioctl(struct net_devi
 	struct scc_mem_config memcfg;
 	struct scc_hw_config hwcfg;
 	struct scc_calibrate cal;
-	struct scc_channel *scc = (struct scc_channel *) dev->priv;
+	struct scc_channel *scc = dev->priv;
 	int chan;
 	unsigned char device_name[IFNAMSIZ];
 	void __user *arg = ifr->ifr_data;
@@ -1951,7 +1951,7 @@ static int scc_net_set_mac_address(struc
 
 static struct net_device_stats *scc_net_get_stats(struct net_device *dev)
 {
-	struct scc_channel *scc = (struct scc_channel *) dev->priv;
+	struct scc_channel *scc = dev->priv;
 	
 	scc->dev_stat.rx_errors = scc->stat.rxerrs + scc->stat.rx_over;
 	scc->dev_stat.tx_errors = scc->stat.txerrs + scc->stat.tx_under;
drivers/net/sunhme.c +1 -1
@@ -3035,7 +3035,7 @@ static int __devinit happy_meal_pci_prob
 
 	dev->base_addr = (long) pdev;
 
-	hp = (struct happy_meal *)dev->priv;
+	hp = dev->priv;
 	memset(hp, 0, sizeof(*hp));
 
 	hp->happy_dev = pdev;
drivers/net/atarilance.c +10 -10
@@ -521,7 +521,7 @@ static unsigned long __init lance_probe1
 	return( 0 );
 
   probe_ok:
-	lp = (struct lance_private *)dev->priv;
+	lp = dev->priv;
 	MEM = (struct lance_memory *)memaddr;
 	IO = lp->iobase = (struct lance_ioreg *)ioaddr;
 	dev->base_addr = (unsigned long)ioaddr; /* informational only */
@@ -641,7 +641,7 @@ static unsigned long __init lance_probe1
 
 static int lance_open( struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	struct lance_ioreg	 *IO = lp->iobase;
 	int i;
 
@@ -682,7 +682,7 @@ static int lance_open( struct net_device
 
 static void lance_init_ring( struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	int i;
 	unsigned offset;
 
@@ -730,7 +730,7 @@ static void lance_init_ring( struct net_
 
 static void lance_tx_timeout (struct net_device *dev)
 {
-	struct lance_private *lp = (struct lance_private *) dev->priv;
+	struct lance_private *lp = dev->priv;
 	struct lance_ioreg	 *IO = lp->iobase;
 
 	AREG = CSR0;
@@ -773,7 +773,7 @@ static void lance_tx_timeout (struct net
 
 static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	struct lance_ioreg	 *IO = lp->iobase;
 	int entry, len;
 	struct lance_tx_head *head;
@@ -865,7 +865,7 @@ static irqreturn_t lance_interrupt( int 
 		return IRQ_NONE;
 	}
 
-	lp = (struct lance_private *)dev->priv;
+	lp = dev->priv;
 	IO = lp->iobase;
 	spin_lock (&lp->devlock);
 
@@ -966,7 +966,7 @@ static irqreturn_t lance_interrupt( int 
 
 static int lance_rx( struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	int entry = lp->cur_rx & RX_RING_MOD_MASK;
 	int i;
 
@@ -1058,7 +1058,7 @@ static int lance_rx( struct net_device *
 
 static int lance_close( struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	struct lance_ioreg	 *IO = lp->iobase;
 
 	netif_stop_queue (dev);
@@ -1085,7 +1085,7 @@ static int lance_close( struct net_devic
 
 static void set_multicast_list( struct net_device *dev )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	struct lance_ioreg	 *IO = lp->iobase;
 
 	if (netif_running(dev))
@@ -1127,7 +1127,7 @@ static void set_multicast_list( struct n
 
 static int lance_set_mac_address( struct net_device *dev, void *addr )
 
-{	struct lance_private *lp = (struct lance_private *)dev->priv;
+{	struct lance_private *lp = dev->priv;
 	struct sockaddr *saddr = addr;
 	int i;
 
drivers/net/3c523.c +12 -12
@@ -309,7 +309,7 @@ static int elmc_open(struct net_device *
 
 static int __init check586(struct net_device *dev, unsigned long where, unsigned size)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	char *iscp_addrs[2];
 	int i = 0;
 
@@ -350,7 +350,7 @@ static int __init check586(struct net_de
 
 void alloc586(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	elmc_id_reset586();
 	DELAY(2);
@@ -617,7 +617,7 @@ static int init586(struct net_device *de
 	void *ptr;
 	unsigned long s;
 	int i, result = 0;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	volatile struct configure_cmd_struct *cfg_cmd;
 	volatile struct iasetup_cmd_struct *ias_cmd;
 	volatile struct tdr_cmd_struct *tdr_cmd;
@@ -855,7 +855,7 @@ static void *alloc_rfa(struct net_device
 	volatile struct rfd_struct *rfd = (struct rfd_struct *) ptr;
 	volatile struct rbd_struct *rbd;
 	int i;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	memset((char *) rfd, 0, sizeof(struct rfd_struct) * p->num_recv_buffs);
 	p->rfd_first = rfd;
@@ -916,7 +916,7 @@ elmc_interrupt(int irq, void *dev_id)
 	}
 	/* reading ELMC_CTRL also clears the INT bit. */
 
-	p = (struct priv *) dev->priv;
+	p = dev->priv;
 
 	while ((stat = p->scb->status & STAT_MASK))
 	{
@@ -972,7 +972,7 @@ static void elmc_rcv_int(struct net_devi
 	unsigned short totlen;
 	struct sk_buff *skb;
 	struct rbd_struct *rbd;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	for (; (status = p->rfd_top->status) & STAT_COMPL;) {
 		rbd = (struct rbd_struct *) make32(p->rfd_top->rbd_offset);
@@ -1016,7 +1016,7 @@ static void elmc_rcv_int(struct net_devi
 
 static void elmc_rnr_int(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	p->stats.rx_errors++;
 
@@ -1039,7 +1039,7 @@ static void elmc_rnr_int(struct net_devi
 static void elmc_xmt_int(struct net_device *dev)
 {
 	int status;
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	status = p->xmit_cmds[p->xmit_last]->cmd_status;
 	if (!(status & STAT_COMPL)) {
@@ -1082,7 +1082,7 @@ static void elmc_xmt_int(struct net_devi
 
 static void startrecv586(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	p->scb->rfa_offset = make16(p->rfd_first);
 	p->scb->cmd = RUC_START;
@@ -1096,7 +1096,7 @@ static void startrecv586(struct net_devi
 
 static void elmc_timeout(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	/* COMMAND-UNIT active? */
 	if (p->scb->status & CU_ACTIVE) {
 #ifdef DEBUG
@@ -1132,7 +1132,7 @@ static int elmc_send_packet(struct sk_bu
 #ifndef NO_NOPCOMMANDS
 	int next_nop;
 #endif
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 
 	netif_stop_queue(dev);
 
@@ -1203,7 +1203,7 @@ static int elmc_send_packet(struct sk_bu
 
 static struct net_device_stats *elmc_get_stats(struct net_device *dev)
 {
-	struct priv *p = (struct priv *) dev->priv;
+	struct priv *p = dev->priv;
 	unsigned short crc, aln, rsc, ovrn;
 
 	crc = p->scb->crc_errs;	/* get error-statistic from the ni82586 */
drivers/net/sunbmac.c +6 -6
@@ -914,7 +914,7 @@ static irqreturn_t bigmac_interrupt(int 
 
 static int bigmac_open(struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 	int ret;
 
 	ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
@@ -931,7 +931,7 @@ static int bigmac_open(struct net_device
 
 static int bigmac_close(struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 
 	del_timer(&bp->bigmac_timer);
 	bp->timer_state = asleep;
@@ -945,7 +945,7 @@ static int bigmac_close(struct net_devic
 
 static void bigmac_tx_timeout(struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 
 	bigmac_init_hw(bp, 0);
 	netif_wake_queue(dev);
@@ -954,7 +954,7 @@ static void bigmac_tx_timeout(struct net
 /* Put a packet on the wire. */
 static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 	int len, entry;
 	u32 mapping;
 
@@ -986,7 +986,7 @@ static int bigmac_start_xmit(struct sk_b
 
 static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 
 	bigmac_get_counters(bp, bp->bregs);
 	return &bp->enet_stats;
@@ -994,7 +994,7 @@ static struct net_device_stats *bigmac_g
 
 static void bigmac_set_multicast(struct net_device *dev)
 {
-	struct bigmac *bp = (struct bigmac *) dev->priv;
+	struct bigmac *bp = dev->priv;
 	void __iomem *bregs = bp->bregs;
 	struct dev_mc_list *dmi = dev->mc_list;
 	char *addrs;
drivers/net/rionet.c +3 -3
@@ -243,7 +243,7 @@ static void rionet_inb_msg_event(struct 
 {
 	int n;
 	struct net_device *ndev = dev_id;
-	struct rionet_private *rnet = (struct rionet_private *)ndev->priv;
+	struct rionet_private *rnet = ndev->priv;
 
 	if (netif_msg_intr(rnet))
 		printk(KERN_INFO "%s: inbound message event, mbox %d slot %d\n",
@@ -351,7 +351,7 @@ static int rionet_open(struct net_device
 
 static int rionet_close(struct net_device *ndev)
 {
-	struct rionet_private *rnet = (struct rionet_private *)ndev->priv;
+	struct rionet_private *rnet = ndev->priv;
 	struct rionet_peer *peer, *tmp;
 	int i;
 
@@ -456,7 +456,7 @@ static int rionet_setup_netdev(struct ri
 				RIO_MAX_ROUTE_ENTRIES(mport->sys_size));
 
 	/* Set up private area */
-	rnet = (struct rionet_private *)ndev->priv;
+	rnet = ndev->priv;
 	rnet->mport = mport;
 
 	/* Set the default MAC address */
drivers/net/pppol2tp.c +1 -1
@@ -968,7 +968,7 @@ error:
 static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 {
 	static const u8 ppph[2] = { 0xff, 0x03 };
-	struct sock *sk = (struct sock *) chan->private;
+	struct sock *sk = chan->private;
 	struct sock *sk_tun;
 	int hdr_len;
 	struct pppol2tp_session *session;
drivers/net/3c505.c +3 -3
@@ -643,7 +643,7 @@ static irqreturn_t elp_interrupt(int irq
 	unsigned long timeout;
 
 	dev = dev_id;
-	adapter = (elp_device *) dev->priv;
+	adapter = dev->priv;
 
 	spin_lock(&adapter->lock);
 
@@ -1104,7 +1104,7 @@ static int elp_start_xmit(struct sk_buff
 
 static struct net_device_stats *elp_get_stats(struct net_device *dev)
 {
-	elp_device *adapter = (elp_device *) dev->priv;
+	elp_device *adapter = dev->priv;
 
 	if (elp_debug >= 3)
 		printk(KERN_DEBUG "%s: request for stats\n", dev->name);
@@ -1209,7 +1209,7 @@ static int elp_close(struct net_device *
 
 static void elp_set_mc_list(struct net_device *dev)
 {
-	elp_device *adapter = (elp_device *) dev->priv;
+	elp_device *adapter = dev->priv;
 	struct dev_mc_list *dmi = dev->mc_list;
 	int i;
 	unsigned long flags;
drivers/net/sunqe.c +5 -5
@@ -511,7 +511,7 @@ static irqreturn_t qec_interrupt(int irq
 
 static int qe_open(struct net_device *dev)
 {
-	struct sunqe *qep = (struct sunqe *) dev->priv;
+	struct sunqe *qep = dev->priv;
 
 	qep->mconfig = (MREGS_MCONFIG_TXENAB |
 			MREGS_MCONFIG_RXENAB |
@@ -521,7 +521,7 @@ static int qe_open(struct net_device *de
 
 static int qe_close(struct net_device *dev)
 {
-	struct sunqe *qep = (struct sunqe *) dev->priv;
+	struct sunqe *qep = dev->priv;
 
 	qe_stop(qep);
 	return 0;
@@ -547,7 +547,7 @@ static void qe_tx_reclaim(struct sunqe *
 
 static void qe_tx_timeout(struct net_device *dev)
 {
-	struct sunqe *qep = (struct sunqe *) dev->priv;
+	struct sunqe *qep = dev->priv;
 	int tx_full;
 
 	spin_lock_irq(&qep->lock);
@@ -573,7 +573,7 @@ out:
 /* Get a packet queued to go onto the wire. */
 static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	struct sunqe *qep = (struct sunqe *) dev->priv;
+	struct sunqe *qep = dev->priv;
 	struct sunqe_buffers *qbufs = qep->buffers;
 	__u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma;
 	unsigned char *txbuf;
@@ -625,7 +625,7 @@ static int qe_start_xmit(struct sk_buff 
 
 static void qe_set_multicast(struct net_device *dev)
 {
-	struct sunqe *qep = (struct sunqe *) dev->priv;
+	struct sunqe *qep = dev->priv;
 	struct dev_mc_list *dmi = dev->mc_list;
 	u8 new_mconfig = qep->mconfig;
 	char *addrs;
drivers/net/dm9000.c +14 -14
@@ -308,7 +308,7 @@ static void dm9000_schedule_poll(board_i
 /* Our watchdog timed out. Called by the networking layer */
 static void dm9000_timeout(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	u8 reg_save;
 	unsigned long flags;
 
@@ -546,7 +546,7 @@ dm9000_probe(struct platform_device *pde
 	dev_dbg(&pdev->dev, "dm9000_probe()\n");
 
 	/* setup board info structure */
-	db = (struct board_info *) ndev->priv;
+	db = ndev->priv;
 	memset(db, 0, sizeof (*db));
 
 	db->dev = &pdev->dev;
@@ -755,7 +755,7 @@ out:
 static int
 dm9000_open(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	unsigned long irqflags = db->irq_res->flags & IRQF_TRIGGER_MASK;
 
 	if (netif_msg_ifup(db))
@@ -795,7 +795,7 @@ dm9000_open(struct net_device *dev)
 static void
 dm9000_init_dm9000(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 
 	dm9000_dbg(db, 1, "entering %s\n", __func__);
 
@@ -839,7 +839,7 @@ static int
 dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 	unsigned long flags;
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 
 	dm9000_dbg(db, 3, "%s:\n", __func__);
 
@@ -882,7 +882,7 @@ dm9000_start_xmit(struct sk_buff *skb, s
 static void
 dm9000_shutdown(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 
 	/* RESET device */
 	dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET);	/* PHY RESET */
@@ -898,7 +898,7 @@ dm9000_shutdown(struct net_device *dev)
 static int
 dm9000_stop(struct net_device *ndev)
 {
-	board_info_t *db = (board_info_t *) ndev->priv;
+	board_info_t *db = ndev->priv;
 
 	if (netif_msg_ifdown(db))
 		dev_dbg(db->dev, "shutting down %s\n", ndev->name);
@@ -949,7 +949,7 @@ static irqreturn_t
 dm9000_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = dev_id;
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	int int_status;
 	u8 reg_save;
 
@@ -1003,7 +1003,7 @@ struct dm9000_rxhdr {
 static void
 dm9000_rx(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	struct dm9000_rxhdr rxhdr;
 	struct sk_buff *skb;
 	u8 rxbyte, *rdptr;
@@ -1215,7 +1215,7 @@ dm9000_write_eeprom(board_info_t *db, in
 static void
 dm9000_hash_table(struct net_device *dev)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	struct dev_mc_list *mcptr = dev->mc_list;
 	int mc_cnt = dev->mc_count;
 	int i, oft;
@@ -1279,7 +1279,7 @@ static void dm9000_msleep(board_info_t *
 static int
 dm9000_phy_read(struct net_device *dev, int phy_reg_unused, int reg)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	unsigned long flags;
 	unsigned int reg_save;
 	int ret;
@@ -1325,7 +1325,7 @@ dm9000_phy_read(struct net_device *dev, 
 static void
 dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
 {
-	board_info_t *db = (board_info_t *) dev->priv;
+	board_info_t *db = dev->priv;
 	unsigned long flags;
 	unsigned long reg_save;
 
@@ -1370,7 +1370,7 @@ dm9000_drv_suspend(struct platform_devic
 	board_info_t *db;
 
 	if (ndev) {
-		db = (board_info_t *) ndev->priv;
+		db = ndev->priv;
 		db->in_suspend = 1;
 
 		if (netif_running(ndev)) {
@@ -1385,7 +1385,7 @@ static int
 dm9000_drv_resume(struct platform_device *dev)
 {
 	struct net_device *ndev = platform_get_drvdata(dev);
-	board_info_t *db = (board_info_t *) ndev->priv;
+	board_info_t *db = ndev->priv;
 
 	if (ndev) {
 
drivers/net/pppoe.c +1 -1
@@ -907,7 +907,7 @@ abort:
  ***********************************************************************/
 static int pppoe_xmit(struct ppp_channel *chan, struct sk_buff *skb)
 {
-	struct sock *sk = (struct sock *) chan->private;
+	struct sock *sk = chan->private;
 	return __pppoe_xmit(sk, skb);
 }
 
drivers/misc/sgi-xp/xpnet.c +4 -5
@@ -170,8 +170,7 @@ xpnet_receive(short partid, int channel,
 {
 	struct sk_buff *skb;
 	bte_result_t bret;
-	struct xpnet_dev_private *priv =
-	    (struct xpnet_dev_private *)xpnet_device->priv;
+	struct xpnet_dev_private *priv = xpnet_device->priv;
 
 	if (!XPNET_VALID_MSG(msg)) {
 		/*
@@ -395,7 +394,7 @@ xpnet_dev_get_stats(struct net_device *d
 {
 	struct xpnet_dev_private *priv;
 
-	priv = (struct xpnet_dev_private *)dev->priv;
+	priv = dev->priv;
 
 	return &priv->stats;
 }
@@ -448,7 +447,7 @@ xpnet_dev_hard_start_xmit(struct sk_buff
 	struct xpnet_dev_private *priv;
 	u16 embedded_bytes;
 
-	priv = (struct xpnet_dev_private *)dev->priv;
+	priv = dev->priv;
 
 	dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
 		"skb->end=0x%p skb->len=%d\n", (void *)skb->head,
@@ -585,7 +584,7 @@ xpnet_dev_tx_timeout(struct net_device *
 {
 	struct xpnet_dev_private *priv;
 
-	priv = (struct xpnet_dev_private *)dev->priv;
+	priv = dev->priv;
 
 	priv->stats.tx_errors++;
 	return;
drivers/s390/net/lcs.c +5 -5
@@ -1286,7 +1286,7 @@ lcs_set_multicast_list(struct net_device
         struct lcs_card *card;
 
         LCS_DBF_TEXT(4, trace, "setmulti");
-        card = (struct lcs_card *) dev->priv;
+        card = dev->priv;
 
         if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD))
 		schedule_work(&card->kernel_thread_starter);
@@ -1601,7 +1601,7 @@ lcs_start_xmit(struct sk_buff *skb, stru
 	int rc;
 
 	LCS_DBF_TEXT(5, trace, "pktxmit");
-	card = (struct lcs_card *) dev->priv;
+	card = dev->priv;
 	rc = __lcs_start_xmit(card, skb, dev);
 	return rc;
 }
@@ -1857,7 +1857,7 @@ lcs_getstats(struct net_device *dev)
 	struct lcs_card *card;
 
 	LCS_DBF_TEXT(4, trace, "netstats");
-	card = (struct lcs_card *) dev->priv;
+	card = dev->priv;
 	return &card->stats;
 }
 
@@ -1872,7 +1872,7 @@ lcs_stop_device(struct net_device *dev)
 	int rc;
 
 	LCS_DBF_TEXT(2, trace, "stopdev");
-	card   = (struct lcs_card *) dev->priv;
+	card   = dev->priv;
 	netif_carrier_off(dev);
 	netif_tx_disable(dev);
 	dev->flags &= ~IFF_UP;
@@ -1895,7 +1895,7 @@ lcs_open_device(struct net_device *dev)
 	int rc;
 
 	LCS_DBF_TEXT(2, trace, "opendev");
-	card = (struct lcs_card *) dev->priv;
+	card = dev->priv;
 	/* initialize statistics */
 	rc = lcs_detect(card);
 	if (rc) {
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -1845,7 +1845,7 @@ static void qeth_l3_vlan_rx_register(str
 static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 {
 	struct net_device *vlandev;
-	struct qeth_card *card = (struct qeth_card *) dev->priv;
+	struct qeth_card *card = dev->priv;
 	struct in_device *in_dev;
 
 	if (card->info.type == QETH_CARD_TYPE_IQD)
drivers/s390/net/claw.c +4 -4
@@ -530,7 +530,7 @@ claw_open(struct net_device *dev)
 	 	printk(KERN_WARNING "claw: Bad device at open failing \n");
 		return -ENODEV;
 	}
-	privptr = (struct claw_privbk *)dev->priv;
+	privptr = dev->priv;
         /*   allocate and initialize CCW blocks */
 	if (privptr->buffs_alloc == 0) {
 	        rc=init_ccw_bk(dev);
@@ -1009,7 +1009,7 @@ claw_irq_tasklet ( unsigned long data )
 #endif
 	CLAW_DBF_TEXT(4,trace,"IRQtask");
 
-        privptr = (struct claw_privbk *) dev->priv;
+        privptr = dev->priv;
 
 #ifdef DEBUGMSG
         printk(KERN_INFO "%s: bh routine - state-%02x\n" ,
@@ -1044,7 +1044,7 @@ claw_release(struct net_device *dev)
 
 	if (!dev)
                 return 0;
-        privptr = (struct claw_privbk *) dev->priv;
+        privptr = dev->priv;
         if (!privptr)
                 return 0;
 #ifdef FUNCTRACE
@@ -1243,7 +1243,7 @@ claw_write_next ( struct chbk * p_ch )
         if (p_ch->claw_state == CLAW_STOP)
                 return;
         dev = (struct net_device *) p_ch->ndev;
-	privptr = (struct claw_privbk *) dev->priv;
+	privptr = dev->priv;
         claw_free_wrt_buf( dev );
 	if ((privptr->write_free_count > 0) &&
 	    !skb_queue_empty(&p_ch->collect_queue)) {
drivers/s390/crypto/zcrypt_pcixcc.c +1 -2
@@ -677,8 +677,7 @@ static void zcrypt_pcixcc_receive(struct
 		.type = TYPE82_RSP_CODE,
 		.reply_code = REP82_ERROR_MACHINE_FAILURE,
 	};
-	struct response_type *resp_type =
-		(struct response_type *) msg->private;
+	struct response_type *resp_type = msg->private;
 	struct type86x_reply *t86r = reply->message;
 	int length;
 
drivers/s390/block/dasd_fba.c +1 -1
@@ -123,7 +123,7 @@ dasd_fba_check_characteristics(struct da
 	void *rdc_data;
 	int rc;
 
-	private = (struct dasd_fba_private *) device->private;
+	private = device->private;
 	if (private == NULL) {
 		private = kzalloc(sizeof(struct dasd_fba_private),
 				  GFP_KERNEL | GFP_DMA);
drivers/s390/block/dasd_alias.c +14 -14
@@ -187,7 +187,7 @@ int dasd_alias_make_device_known_to_lcu(
 	int is_lcu_known;
 	struct dasd_uid *uid;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	uid = &private->uid;
 	spin_lock_irqsave(&aliastree.lock, flags);
 	is_lcu_known = 1;
@@ -249,7 +249,7 @@ void dasd_alias_disconnect_device_from_l
 	struct alias_server *server;
 	int was_pending;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	lcu = private->lcu;
 	spin_lock_irqsave(&lcu->lock, flags);
 	list_del_init(&device->alias_list);
@@ -308,7 +308,7 @@ static int _add_device_to_lcu(struct ali
 	struct alias_pav_group *group;
 	struct dasd_uid *uid;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	uid = &private->uid;
 	uid->type = lcu->uac->unit[uid->real_unit_addr].ua_type;
 	uid->base_unit_addr = lcu->uac->unit[uid->real_unit_addr].base_ua;
@@ -351,7 +351,7 @@ static void _remove_device_from_lcu(stru
 	struct dasd_eckd_private *private;
 	struct alias_pav_group *group;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	list_move(&device->alias_list, &lcu->inactive_devices);
 	group = private->pavgroup;
 	if (!group)
@@ -441,13 +441,13 @@ static int _lcu_update(struct dasd_devic
 		list_for_each_entry_safe(device, tempdev, &pavgroup->baselist,
 					 alias_list) {
 			list_move(&device->alias_list, &lcu->active_devices);
-			private = (struct dasd_eckd_private *) device->private;
+			private = device->private;
 			private->pavgroup = NULL;
 		}
 		list_for_each_entry_safe(device, tempdev, &pavgroup->aliaslist,
 					 alias_list) {
 			list_move(&device->alias_list, &lcu->active_devices);
-			private = (struct dasd_eckd_private *) device->private;
+			private = device->private;
 			private->pavgroup = NULL;
 		}
 		list_del(&pavgroup->group);
@@ -559,7 +559,7 @@ int dasd_alias_add_device(struct dasd_de
 	unsigned long flags;
 	int rc;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	lcu = private->lcu;
 	rc = 0;
 	spin_lock_irqsave(&lcu->lock, flags);
@@ -582,7 +582,7 @@ int dasd_alias_remove_device(struct dasd
 	struct alias_lcu *lcu;
 	unsigned long flags;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 	lcu = private->lcu;
 	spin_lock_irqsave(&lcu->lock, flags);
 	_remove_device_from_lcu(lcu, device);
@@ -599,7 +599,7 @@ struct dasd_device *dasd_alias_get_start
 	struct dasd_eckd_private *private, *alias_priv;
 	unsigned long flags;
 
-	private = (struct dasd_eckd_private *) base_device->private;
+	private = base_device->private;
 	group = private->pavgroup;
 	lcu = private->lcu;
 	if (!group || !lcu)
@@ -627,7 +627,7 @@ struct dasd_device *dasd_alias_get_start
 		group->next = list_first_entry(&alias_device->alias_list,
 					       struct dasd_device, alias_list);
 	spin_unlock_irqrestore(&lcu->lock, flags);
-	alias_priv = (struct dasd_eckd_private *) alias_device->private;
+	alias_priv = alias_device->private;
 	if ((alias_priv->count < private->count) && !alias_device->stopped)
 		return alias_device;
 	else
@@ -675,14 +675,14 @@ static void _restart_all_base_devices_on
 
 	/* active and inactive list can contain alias as well as base devices */
 	list_for_each_entry(device, &lcu->active_devices, alias_list) {
-		private = (struct dasd_eckd_private *) device->private;
+		private = device->private;
 		if (private->uid.type != UA_BASE_DEVICE)
 			continue;
 		dasd_schedule_block_bh(device->block);
 		dasd_schedule_device_bh(device);
 	}
 	list_for_each_entry(device, &lcu->inactive_devices, alias_list) {
-		private = (struct dasd_eckd_private *) device->private;
+		private = device->private;
 		if (private->uid.type != UA_BASE_DEVICE)
 			continue;
 		dasd_schedule_block_bh(device->block);
@@ -719,7 +719,7 @@ static void flush_all_alias_devices_on_l
 	spin_lock_irqsave(&lcu->lock, flags);
 	list_for_each_entry_safe(device, temp, &lcu->active_devices,
 				 alias_list) {
-		private = (struct dasd_eckd_private *) device->private;
+		private = device->private;
 		if (private->uid.type == UA_BASE_DEVICE)
 			continue;
 		list_move(&device->alias_list, &active);
@@ -854,7 +854,7 @@ void dasd_alias_handle_summary_unit_chec
 	char reason;
 	struct dasd_eckd_private *private;
 
-	private = (struct dasd_eckd_private *) device->private;
+	private = device->private;
 
 	reason = irb->ecw[8];
 	DEV_MESSAGE(KERN_WARNING, device, "%s %x",
drivers/s390/block/dasd_eckd.c +20 -22

2 lines not on this page · raw message

drivers/s390/block/dasd_diag.c +5 -5

Lines of this file are not shown. View the raw message.

drivers/md/dm-crypt.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/md/dm-mpath.c +7 -7

Lines of this file are not shown. View the raw message.

drivers/md/raid5.c +5 -5

Lines of this file are not shown. View the raw message.

drivers/md/dm-linear.c +4 -4

Lines of this file are not shown. View the raw message.

drivers/md/faulty.c +3 -3

Lines of this file are not shown. View the raw message.

drivers/md/dm-raid1.c +4 -4

Lines of this file are not shown. View the raw message.

drivers/md/dm-stripe.c +3 -3

Lines of this file are not shown. View the raw message.

drivers/isdn/i4l/isdn_net.c +9 -9

Lines of this file are not shown. View the raw message.

drivers/isdn/i4l/isdn_concap.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/isdn/i4l/isdn_ppp.c +4 -4

Lines of this file are not shown. View the raw message.

drivers/acpi/processor_thermal.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/media/video/cx18/cx18-dvb.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/media/video/usbvideo/vicam.c +1 -2

Lines of this file are not shown. View the raw message.

drivers/media/video/au0828/au0828-dvb.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/media/video/pwc/pwc-if.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/media/dvb/bt8xx/dst_ca.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/media/dvb/ttpci/av7110_av.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/media/dvb/ttpci/budget-core.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/media/dvb/ttusb-dec/ttusb_dec.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/message/i2o/i2o_proc.c +19 -19

Lines of this file are not shown. View the raw message.

drivers/pci/pci-sysfs.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/pci/hotplug/rpaphp_slot.c +2 -2

Lines of this file are not shown. View the raw message.

drivers/pci/hotplug/rpaphp_core.c +7 -7

Lines of this file are not shown. View the raw message.

drivers/usb/serial/kl5kusb105.c +1 -1

Lines of this file are not shown. View the raw message.

drivers/mtd/devices/mtd_dataflash.c +3 -3

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/nandsim.c +2 -2

Lines of this file are not shown. View the raw message.

net/atm/lec.c +10 -10

Lines of this file are not shown. View the raw message.

net/atm/mpc.c +1 -1

Lines of this file are not shown. View the raw message.

net/ipv6/proc.c +1 -1

Lines of this file are not shown. View the raw message.

net/ipv6/route.c +3 -3

Lines of this file are not shown. View the raw message.

net/8021q/vlanproc.c +1 -1

Lines of this file are not shown. View the raw message.

net/irda/irnet/irnet_ppp.c +2 -2

Lines of this file are not shown. View the raw message.

net/9p/trans_fd.c +3 -3

Lines of this file are not shown. View the raw message.

net/ipv4/fib_trie.c +1 -1

Lines of this file are not shown. View the raw message.

net/netfilter/x_tables.c +4 -4

Lines of this file are not shown. View the raw message.

net/sunrpc/rpc_pipe.c +1 -1

Lines of this file are not shown. View the raw message.

fs/nfs/idmap.c +1 -1

Lines of this file are not shown. View the raw message.

fs/ocfs2/dlm/dlmdebug.c +1 -1

Lines of this file are not shown. View the raw message.

virt/kvm/ioapic.c +3 -3

Lines of this file are not shown. View the raw message.

arch/powerpc/platforms/pseries/hvCall_inst.c +1 -1

Lines of this file are not shown. View the raw message.

arch/x86/kvm/i8254.c +4 -4

Lines of this file are not shown. View the raw message.

arch/x86/kvm/lapic.c +3 -3

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/mailbox.c +4 -4

Lines of this file are not shown. View the raw message.

arch/ppc/8260_io/fcc_enet.c +4 -4

Lines of this file are not shown. View the raw message.

arch/ppc/8260_io/enet.c +4 -4

Lines of this file are not shown. View the raw message.

arch/ppc/8xx_io/fec.c +3 -3

Lines of this file are not shown. View the raw message.

arch/ppc/8xx_io/enet.c +6 -6

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 3 lines · Philipp Marek

Hello everybody,

here's another trivial patch, against v2.6.26-rc3-243-gd40ace0.

Sample from your patch:
static int geode_rng_data_read(struct hwrng *rng, u32 *data) {
- void __iomem *mem = (void __iomem *)rng->priv;
+ void __iomem *mem = rng->priv;

And from hw_random.h:

struct hwrng {
        const char *name;
        int (*init)(struct hwrng *rng);
        void (*cleanup)(struct hwrng *rng);
        int (*data_present)(struct hwrng *rng, int wait);
        int (*data_read)(struct hwrng *rng, u32 *data);
        unsigned long priv;

        /* internal. */
        struct list_head list;
};

So rng->priv is unsigend long.
Therefore the cast is legitimate.

And I expect gcc to emit:
warning: assignment makes pointer from integer without a cast

Sam

#2 lore raw

Hello Sam,

Quoted 1 line · you

Sample from your patch:

...

Quoted 4 lines

Therefore the cast is legitimate.

And I expect gcc to emit:
warning: assignment makes pointer from integer without a cast

Possibly mine didn't ... I'm getting some build errors related to static variables being initialized via htonl(), but I did a compile run with this patch.

I think I used a clean kernel for testing - but maybe I was in the tree where I tested converting some "unsigned long priv;" to "void*", looking

Quoted 4 lines · for problems - as I
Quoted 4 lines

There are some private structure variables that are not defined as (void*), (but int or long) and cannot be done without a cast; examples in
drivers/char/hw_random/intel-rng.c

...

Quoted 2 lines
Quoted 2 lines

Should these be converted to (void*), and an additional patch supplied?

If I do a patch for them, can that be a trivial patch, or should I send each type conversion to the maintainer?

Regards,

Phil