linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Remove unnecessary casts of netdev_priv
@ 2010-11-15 21:12 Joe Perches
  2010-11-15 21:12 ` [PATCH 01/10] drivers/isdn/i4l: " Joe Perches
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: netdev, linux-kernel, bonding-devel, linux-usb, devel

Joe Perches (10):
  drivers/isdn/i4l: Remove unnecessary casts of netdev_priv
  drivers/net/bonding: Remove unnecessary casts of netdev_priv
  drivers/net/pcmcia: Remove unnecessary casts of netdev_priv
  drivers/net/qla3xxx.c: Remove unnecessary casts of netdev_priv
  drivers/net/qlge: Remove unnecessary casts of netdev_priv
  drivers/net/usb: Remove unnecessary casts of netdev_priv
  drivers/net/vxge: Remove unnecessary casts of netdev_priv
  drivers/net: Remove unnecessary casts of netdev_priv
  drivers/staging: Remove unnecessary casts of netdev_priv
  net/atm: Remove unnecessary casts of netdev_priv

 drivers/isdn/i4l/isdn_concap.c                     |    2 +-
 drivers/isdn/i4l/isdn_net.c                        |   20 ++++----
 drivers/isdn/i4l/isdn_ppp.c                        |   12 ++--
 drivers/net/ax88796.c                              |    8 ++--
 drivers/net/bonding/bond_3ad.c                     |    3 +-
 drivers/net/bonding/bonding.h                      |    2 +-
 drivers/net/dm9000.c                               |    2 +-
 drivers/net/iseries_veth.c                         |    2 +-
 drivers/net/lib8390.c                              |   24 ++++----
 drivers/net/ne-h8300.c                             |   12 ++--
 drivers/net/pcmcia/axnet_cs.c                      |   18 +++---
 drivers/net/qla3xxx.c                              |    8 ++--
 drivers/net/qlge/qlge_main.c                       |    8 ++--
 drivers/net/usb/pegasus.c                          |    4 +-
 drivers/net/vxge/vxge-ethtool.c                    |   26 +++++-----
 drivers/net/vxge/vxge-main.c                       |   26 +++++-----
 drivers/net/xilinx_emaclite.c                      |   20 ++++----
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   |   54 ++++++++++----------
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c |    8 ++--
 drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c   |    8 ++--
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c      |   16 +++---
 drivers/staging/ft1000/ft1000-usb/ft1000_proc.c    |    6 +-
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c     |    2 +-
 drivers/staging/rtl8712/usb_intf.c                 |    2 +-
 net/atm/br2684.c                                   |    2 +-
 net/atm/lec.c                                      |    3 +-
 26 files changed, 148 insertions(+), 150 deletions(-)

-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 01/10] drivers/isdn/i4l: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:39   ` David Miller
  2010-11-15 21:12 ` [PATCH 02/10] drivers/net/bonding: " Joe Perches
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Karsten Keil, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/isdn/i4l/isdn_concap.c |    2 +-
 drivers/isdn/i4l/isdn_net.c    |   20 ++++++++++----------
 drivers/isdn/i4l/isdn_ppp.c    |   12 ++++++------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c
index 46048e5..d568689 100644
--- a/drivers/isdn/i4l/isdn_concap.c
+++ b/drivers/isdn/i4l/isdn_concap.c
@@ -61,7 +61,7 @@ static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *
 static int isdn_concap_dl_connect_req(struct concap_proto *concap)
 {
 	struct net_device *ndev = concap -> net_dev;
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
+	isdn_net_local *lp = netdev_priv(ndev);
 	int ret;
 	IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
 
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 26d44c3..afeede7 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -827,7 +827,7 @@ isdn_net_dial(void)
 void
 isdn_net_hangup(struct net_device *d)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(d);
+	isdn_net_local *lp = netdev_priv(d);
 	isdn_ctrl cmd;
 #ifdef CONFIG_ISDN_X25
 	struct concap_proto *cprot = lp->netdev->cprot;
@@ -1052,7 +1052,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
 {
 	isdn_net_dev *nd;
 	isdn_net_local *slp;
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
+	isdn_net_local *lp = netdev_priv(ndev);
 	int retv = NETDEV_TX_OK;
 
 	if (((isdn_net_local *) netdev_priv(ndev))->master) {
@@ -1116,7 +1116,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
 static void
 isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 	if (!skb)
 		return;
 	if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
@@ -1131,7 +1131,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
 
 static void isdn_net_tx_timeout(struct net_device * ndev)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
+	isdn_net_local *lp = netdev_priv(ndev);
 
 	printk(KERN_WARNING "isdn_tx_timeout dev %s dialstate %d\n", ndev->name, lp->dialstate);
 	if (!lp->dialstate){
@@ -1165,7 +1165,7 @@ static void isdn_net_tx_timeout(struct net_device * ndev)
 static netdev_tx_t
 isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
+	isdn_net_local *lp = netdev_priv(ndev);
 #ifdef CONFIG_ISDN_X25
 	struct concap_proto * cprot = lp -> netdev -> cprot;
 /* At this point hard_start_xmit() passes control to the encapsulation
@@ -1347,7 +1347,7 @@ isdn_net_close(struct net_device *dev)
 static struct net_device_stats *
 isdn_net_get_stats(struct net_device *dev)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 	return &lp->stats;
 }
 
@@ -1426,7 +1426,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
 static int
 isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 	unsigned long len = 0;
 	unsigned long expires = 0;
 	int tmp = 0;
@@ -1493,7 +1493,7 @@ isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 static int isdn_net_ioctl(struct net_device *dev,
 			  struct ifreq *ifr, int cmd)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 
 	switch (lp->p_encap) {
 #ifdef CONFIG_ISDN_PPP
@@ -1786,7 +1786,7 @@ isdn_net_ciscohdlck_receive(isdn_net_local *lp, struct sk_buff *skb)
 static void
 isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
 {
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(ndev);
+	isdn_net_local *lp = netdev_priv(ndev);
 	isdn_net_local *olp = lp;	/* original 'lp' */
 #ifdef CONFIG_ISDN_X25
 	struct concap_proto *cprot = lp -> netdev -> cprot;
@@ -1800,7 +1800,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
 		 * handle master's statistics and hangup-timeout
 		 */
 		ndev = lp->master;
-		lp = (isdn_net_local *) netdev_priv(ndev);
+		lp = netdev_priv(ndev);
 		lp->stats.rx_packets++;
 		lp->stats.rx_bytes += skb->len;
 	}
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index fe824e0..97c5cc2 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -1221,7 +1221,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
 	struct ippp_struct *ipt,*ipts;
 	int slot, retval = NETDEV_TX_OK;
 
-	mlp = (isdn_net_local *) netdev_priv(netdev);
+	mlp = netdev_priv(netdev);
 	nd = mlp->netdev;       /* get master lp */
 
 	slot = mlp->ppp_slot;
@@ -1985,7 +1985,7 @@ isdn_ppp_dev_ioctl_stats(int slot, struct ifreq *ifr, struct net_device *dev)
 {
 	struct ppp_stats __user *res = ifr->ifr_data;
 	struct ppp_stats t;
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 
 	if (!access_ok(VERIFY_WRITE, res, sizeof(struct ppp_stats)))
 		return -EFAULT;
@@ -2024,7 +2024,7 @@ isdn_ppp_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
 	int error=0;
 	int len;
-	isdn_net_local *lp = (isdn_net_local *) netdev_priv(dev);
+	isdn_net_local *lp = netdev_priv(dev);
 
 
 	if (lp->p_encap != ISDN_NET_ENCAP_SYNCPPP)
@@ -2091,7 +2091,7 @@ isdn_ppp_dial_slave(char *name)
 
 	sdev = lp->slave;
 	while (sdev) {
-		isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
+		isdn_net_local *mlp = netdev_priv(sdev);
 		if (!(mlp->flags & ISDN_NET_CONNECTED))
 			break;
 		sdev = mlp->slave;
@@ -2099,7 +2099,7 @@ isdn_ppp_dial_slave(char *name)
 	if (!sdev)
 		return 2;
 
-	isdn_net_dial_req((isdn_net_local *) netdev_priv(sdev));
+	isdn_net_dial_req(netdev_priv(sdev));
 	return 0;
 #else
 	return -1;
@@ -2122,7 +2122,7 @@ isdn_ppp_hangup_slave(char *name)
 
 	sdev = lp->slave;
 	while (sdev) {
-		isdn_net_local *mlp = (isdn_net_local *) netdev_priv(sdev);
+		isdn_net_local *mlp = netdev_priv(sdev);
 
 		if (mlp->slave) { /* find last connected link in chain */
 			isdn_net_local *nlp = ISDN_SLAVE_PRIV(mlp);
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 02/10] drivers/net/bonding: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
  2010-11-15 21:12 ` [PATCH 01/10] drivers/isdn/i4l: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:39   ` David Miller
  2010-11-15 21:12 ` [PATCH 03/10] drivers/net/pcmcia: " Joe Perches
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Jay Vosburgh, bonding-devel, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/bonding/bond_3ad.c |    3 +--
 drivers/net/bonding/bonding.h  |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 106718c..171782e 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2474,8 +2474,7 @@ int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct net_device *dev, struct pac
 		goto out;
 
 	read_lock(&bond->lock);
-	slave = bond_get_slave_by_dev((struct bonding *)netdev_priv(dev),
-					orig_dev);
+	slave = bond_get_slave_by_dev(netdev_priv(dev), orig_dev);
 	if (!slave)
 		goto out_unlock;
 
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 4eedb12..ad3ae46 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -286,7 +286,7 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)
 		return NULL;
 	}
 
-	return (struct bonding *)netdev_priv(slave->dev->master);
+	return netdev_priv(slave->dev->master);
 }
 
 static inline bool bond_is_lb(const struct bonding *bond)
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 03/10] drivers/net/pcmcia: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
  2010-11-15 21:12 ` [PATCH 01/10] drivers/isdn/i4l: " Joe Perches
  2010-11-15 21:12 ` [PATCH 02/10] drivers/net/bonding: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:39   ` David Miller
  2010-11-15 21:12 ` [PATCH 04/10] drivers/net/qla3xxx.c: " Joe Perches
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/pcmcia/axnet_cs.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index d2e166e..c65c9e1 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -865,7 +865,7 @@ static void do_set_multicast_list(struct net_device *dev);
 static int ax_open(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	/*
 	 *	Grab the page lock so we own the register set, then call
@@ -916,7 +916,7 @@ static int ax_close(struct net_device *dev)
 static void axnet_tx_timeout(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int txsr, isr, tickssofar = jiffies - dev_trans_start(dev);
 	unsigned long flags;
 
@@ -963,7 +963,7 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
 					  struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int length, send_length, output_page;
 	unsigned long flags;
 	u8 packet[ETH_ZLEN];
@@ -1260,7 +1260,7 @@ static void ei_tx_err(struct net_device *dev)
 static void ei_tx_intr(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int status = inb(e8390_base + EN0_TSR);
     
 	/*
@@ -1344,7 +1344,7 @@ static void ei_tx_intr(struct net_device *dev)
 static void ei_receive(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned char rxing_page, this_frame, next_frame;
 	unsigned short current_offset;
 	int rx_pkt_count = 0;
@@ -1529,7 +1529,7 @@ static void ei_rx_overrun(struct net_device *dev)
 static struct net_device_stats *get_stats(struct net_device *dev)
 {
 	long ioaddr = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned long flags;
     
 	/* If the card is stopped, just return the present stats. */
@@ -1578,7 +1578,7 @@ static void do_set_multicast_list(struct net_device *dev)
 {
 	long e8390_base = dev->base_addr;
 	int i;
-	struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) {
 		memset(ei_local->mcfilter, 0, 8);
@@ -1636,7 +1636,7 @@ static void AX88190_init(struct net_device *dev, int startp)
 {
 	axnet_dev_t *info = PRIV(dev);
 	long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int i;
 	int endcfg = ei_local->word16 ? (0x48 | ENDCFG_WTS) : 0x48;
     
@@ -1702,7 +1702,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
 								int start_page)
 {
 	long e8390_base = dev->base_addr;
- 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev);
+ 	struct ei_device *ei_local __attribute((unused)) = netdev_priv(dev);
     
 	if (inb_p(e8390_base) & E8390_TRANS) 
 	{
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 04/10] drivers/net/qla3xxx.c: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (2 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 03/10] drivers/net/pcmcia: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:39   ` David Miller
  2010-11-15 21:12 ` [PATCH 05/10] drivers/net/qlge: " Joe Perches
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Ron Mercer, linux-driver, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/qla3xxx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 7496ed2..1a3584e 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -2467,7 +2467,7 @@ map_error:
 static netdev_tx_t ql3xxx_send(struct sk_buff *skb,
 			       struct net_device *ndev)
 {
-	struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
+	struct ql3_adapter *qdev = netdev_priv(ndev);
 	struct ql3xxx_port_registers __iomem *port_regs =
 			qdev->mem_map_registers;
 	struct ql_tx_buf_cb *tx_cb;
@@ -3390,7 +3390,7 @@ static void ql_set_mac_info(struct ql3_adapter *qdev)
 
 static void ql_display_dev_info(struct net_device *ndev)
 {
-	struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
+	struct ql3_adapter *qdev = netdev_priv(ndev);
 	struct pci_dev *pdev = qdev->pdev;
 
 	netdev_info(ndev,
@@ -3573,7 +3573,7 @@ static int ql3xxx_open(struct net_device *ndev)
 
 static int ql3xxx_set_mac_address(struct net_device *ndev, void *p)
 {
-	struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
+	struct ql3_adapter *qdev = netdev_priv(ndev);
 	struct ql3xxx_port_registers __iomem *port_regs =
 			qdev->mem_map_registers;
 	struct sockaddr *addr = p;
@@ -3608,7 +3608,7 @@ static int ql3xxx_set_mac_address(struct net_device *ndev, void *p)
 
 static void ql3xxx_tx_timeout(struct net_device *ndev)
 {
-	struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
+	struct ql3_adapter *qdev = netdev_priv(ndev);
 
 	netdev_err(ndev, "Resetting...\n");
 	/*
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 05/10] drivers/net/qlge: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (3 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 04/10] drivers/net/qla3xxx.c: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:39   ` David Miller
  2010-11-15 21:12 ` [PATCH 06/10] drivers/net/usb: " Joe Perches
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Ron Mercer, linux-driver, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/qlge/qlge_main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c30e0fe..d9a7626 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3844,7 +3844,7 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
 
 static void ql_display_dev_info(struct net_device *ndev)
 {
-	struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
 
 	netif_info(qdev, probe, qdev->ndev,
 		   "Function #%d, Port %d, NIC Roll %d, NIC Rev = %d, "
@@ -4264,7 +4264,7 @@ static struct net_device_stats *qlge_get_stats(struct net_device
 
 static void qlge_set_multicast_list(struct net_device *ndev)
 {
-	struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
 	struct netdev_hw_addr *ha;
 	int i, status;
 
@@ -4354,7 +4354,7 @@ exit:
 
 static int qlge_set_mac_address(struct net_device *ndev, void *p)
 {
-	struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
 	struct sockaddr *addr = p;
 	int status;
 
@@ -4377,7 +4377,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
 
 static void qlge_tx_timeout(struct net_device *ndev)
 {
-	struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
+	struct ql_adapter *qdev = netdev_priv(ndev);
 	ql_queue_asic_error(qdev);
 }
 
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (4 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 05/10] drivers/net/qlge: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-16 17:59   ` Petko Manolov
  2010-11-17 18:40   ` David Miller
  2010-11-15 21:12 ` [PATCH 07/10] drivers/net/vxge: " Joe Perches
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Petko Manolov, Greg Kroah-Hartman, linux-usb, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/usb/pegasus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 6710f093..ef36676 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -359,7 +359,7 @@ fail:
 
 static int mdio_read(struct net_device *dev, int phy_id, int loc)
 {
-	pegasus_t *pegasus = (pegasus_t *) netdev_priv(dev);
+	pegasus_t *pegasus = netdev_priv(dev);
 	u16 res;
 
 	read_mii_word(pegasus, phy_id, loc, &res);
@@ -397,7 +397,7 @@ fail:
 
 static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
 {
-	pegasus_t *pegasus = (pegasus_t *) netdev_priv(dev);
+	pegasus_t *pegasus = netdev_priv(dev);
 
 	write_mii_word(pegasus, phy_id, loc, val);
 }
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 07/10] drivers/net/vxge: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (5 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 06/10] drivers/net/usb: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-15 22:51   ` Jon Mason
  2010-11-17 18:44   ` David Miller
  2010-11-15 21:12 ` [PATCH 08/10] drivers/net: " Joe Perches
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
	Jon Mason, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/vxge/vxge-ethtool.c |   26 +++++++++++++-------------
 drivers/net/vxge/vxge-main.c    |   26 +++++++++++++-------------
 2 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c
index 09f721e..bc9bd10 100644
--- a/drivers/net/vxge/vxge-ethtool.c
+++ b/drivers/net/vxge/vxge-ethtool.c
@@ -80,7 +80,7 @@ static int vxge_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
 static void vxge_ethtool_gdrvinfo(struct net_device *dev,
 				  struct ethtool_drvinfo *info)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	strlcpy(info->driver, VXGE_DRIVER_NAME, sizeof(VXGE_DRIVER_NAME));
 	strlcpy(info->version, DRV_VERSION, sizeof(DRV_VERSION));
 	strlcpy(info->fw_version, vdev->fw_version, VXGE_HW_FW_STRLEN);
@@ -108,7 +108,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
 	enum vxge_hw_status status;
 	u64 reg;
 	u64 *reg_space = (u64 *)space;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 
 	regs->len = sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
@@ -144,7 +144,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
  */
 static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 
 	vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
@@ -166,7 +166,7 @@ static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
 static void vxge_ethtool_getpause_data(struct net_device *dev,
 				       struct ethtool_pauseparam *ep)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 
 	vxge_hw_device_getpause_data(hldev, 0, &ep->tx_pause, &ep->rx_pause);
@@ -185,7 +185,7 @@ static void vxge_ethtool_getpause_data(struct net_device *dev,
 static int vxge_ethtool_setpause_data(struct net_device *dev,
 				      struct ethtool_pauseparam *ep)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 
 	vxge_hw_device_setpause_data(hldev, 0, ep->tx_pause, ep->rx_pause);
@@ -203,7 +203,7 @@ static void vxge_get_ethtool_stats(struct net_device *dev,
 	enum vxge_hw_status status;
 	enum vxge_hw_status swstatus;
 	struct vxge_vpath *vpath = NULL;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct __vxge_hw_device *hldev = vdev->devh;
 	struct vxge_hw_xmac_stats *xmac_stats;
 	struct vxge_hw_device_stats_sw_info *sw_stats;
@@ -572,7 +572,7 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
 {
 	int stat_size = 0;
 	int i, j;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	switch (stringset) {
 	case ETH_SS_STATS:
 		vxge_add_string("VPATH STATISTICS%s\t\t\t",
@@ -1059,21 +1059,21 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
 
 static int vxge_ethtool_get_regs_len(struct net_device *dev)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	return sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
 }
 
 static u32 vxge_get_rx_csum(struct net_device *dev)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	return vdev->rx_csum;
 }
 
 static int vxge_set_rx_csum(struct net_device *dev, u32 data)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	if (data)
 		vdev->rx_csum = 1;
@@ -1095,7 +1095,7 @@ static int vxge_ethtool_op_set_tso(struct net_device *dev, u32 data)
 
 static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	switch (sset) {
 	case ETH_SS_STATS:
@@ -1114,7 +1114,7 @@ static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
 
 static int vxge_set_flags(struct net_device *dev, u32 data)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	enum vxge_hw_status status;
 
 	if (data & ~ETH_FLAG_RXHASH)
@@ -1148,7 +1148,7 @@ static int vxge_set_flags(struct net_device *dev, u32 data)
 
 static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms)
 {
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) {
 		printk(KERN_INFO "Single Function Mode is required to flash the"
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 22c7d79..5cba4a6 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -153,7 +153,7 @@ static void
 vxge_callback_link_up(struct __vxge_hw_device *hldev)
 {
 	struct net_device *dev = hldev->ndev;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
 		vdev->ndev->name, __func__, __LINE__);
@@ -177,7 +177,7 @@ static void
 vxge_callback_link_down(struct __vxge_hw_device *hldev)
 {
 	struct net_device *dev = hldev->ndev;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 
 	vxge_debug_entryexit(VXGE_TRACE,
 		"%s: %s:%d", vdev->ndev->name, __func__, __LINE__);
@@ -787,7 +787,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
 		return NETDEV_TX_OK;
 	}
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 
 	if (unlikely(!is_vxge_card_up(vdev))) {
 		vxge_debug_tx(VXGE_ERR,
@@ -1052,7 +1052,7 @@ static void vxge_set_multicast(struct net_device *dev)
 	vxge_debug_entryexit(VXGE_TRACE,
 		"%s:%d", __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 	hldev = (struct __vxge_hw_device  *)vdev->devh;
 
 	if (unlikely(!is_vxge_card_up(vdev)))
@@ -1209,7 +1209,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 	hldev = vdev->devh;
 
 	if (!is_valid_ether_addr(addr->sa_data))
@@ -1671,7 +1671,7 @@ static void vxge_netpoll(struct net_device *dev)
 	struct __vxge_hw_device *hldev;
 	struct vxgedev *vdev;
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 	hldev = pci_get_drvdata(vdev->pdev);
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
@@ -2581,7 +2581,7 @@ vxge_open(struct net_device *dev)
 	vxge_debug_entryexit(VXGE_TRACE,
 		"%s: %s:%d", dev->name, __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 	hldev = pci_get_drvdata(vdev->pdev);
 	function_mode = vdev->config.device_hw_info.function_mode;
 
@@ -2809,7 +2809,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
 	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
 		dev->name, __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 	hldev = pci_get_drvdata(vdev->pdev);
 
 	if (unlikely(!is_vxge_card_up(vdev)))
@@ -3138,7 +3138,7 @@ vxge_tx_watchdog(struct net_device *dev)
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 
 	vdev->cric_err_event = VXGE_HW_EVENT_RESET_START;
 
@@ -3166,7 +3166,7 @@ vxge_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 
 	vpath = &vdev->vpaths[0];
 	if ((NULL == grp) && (vpath->is_open)) {
@@ -3215,7 +3215,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 	struct vxge_vpath *vpath;
 	int vp_id;
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 
 	/* Add these vlan to the vid table */
 	for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) {
@@ -3242,7 +3242,7 @@ vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 
 	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
 
-	vdev = (struct vxgedev *)netdev_priv(dev);
+	vdev = netdev_priv(dev);
 
 	vlan_group_set_device(vdev->vlgrp, vid, NULL);
 
@@ -3475,7 +3475,7 @@ vxge_callback_crit_err(struct __vxge_hw_device *hldev,
 			enum vxge_hw_event type, u64 vp_id)
 {
 	struct net_device *dev = hldev->ndev;
-	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
+	struct vxgedev *vdev = netdev_priv(dev);
 	struct vxge_vpath *vpath = NULL;
 	int vpath_idx;
 
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 08/10] drivers/net: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (6 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 07/10] drivers/net/vxge: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:45   ` David Miller
  2010-11-15 21:12 ` [PATCH 09/10] drivers/staging: " Joe Perches
  2010-11-15 21:12 ` [PATCH 10/10] net/atm: " Joe Perches
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Paul Gortmaker, Yoshinori Sato, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/ax88796.c         |    8 ++++----
 drivers/net/dm9000.c          |    2 +-
 drivers/net/iseries_veth.c    |    2 +-
 drivers/net/lib8390.c         |   24 ++++++++++++------------
 drivers/net/ne-h8300.c        |   12 ++++++------
 drivers/net/xilinx_emaclite.c |   20 ++++++++++----------
 6 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index b6da4cf..4bebff3 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -325,7 +325,7 @@ static void ax_block_output(struct net_device *dev, int count,
 static void
 ax_mii_ei_outbits(struct net_device *dev, unsigned int bits, int len)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	void __iomem *memr_addr = (void __iomem *)dev->base_addr + AX_MEMR;
 	unsigned int memr;
 
@@ -364,7 +364,7 @@ ax_mii_ei_outbits(struct net_device *dev, unsigned int bits, int len)
 static unsigned int
 ax_phy_ei_inbits(struct net_device *dev, int no)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	void __iomem *memr_addr = (void __iomem *)dev->base_addr + AX_MEMR;
 	unsigned int memr;
 	unsigned int result = 0;
@@ -412,7 +412,7 @@ ax_phy_issueaddr(struct net_device *dev, int phy_addr, int reg, int opc)
 static int
 ax_phy_read(struct net_device *dev, int phy_addr, int reg)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned long flags;
  	unsigned int result;
 
@@ -435,7 +435,7 @@ ax_phy_read(struct net_device *dev, int phy_addr, int reg)
 static void
 ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value)
 {
-	struct ei_device *ei = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei = netdev_priv(dev);
 	struct ax_device  *ax = to_ax_dev(dev);
 	unsigned long flags;
 
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 9f6aeef..2d4c4fc 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1675,7 +1675,7 @@ dm9000_drv_remove(struct platform_device *pdev)
 	platform_set_drvdata(pdev, NULL);
 
 	unregister_netdev(ndev);
-	dm9000_release_board(pdev, (board_info_t *) netdev_priv(ndev));
+	dm9000_release_board(pdev, netdev_priv(ndev));
 	free_netdev(ndev);		/* free device structure */
 
 	dev_dbg(&pdev->dev, "released and freed device\n");
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 8df645e..38e15be 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -1605,7 +1605,7 @@ static int veth_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	}
 	veth_dev[i] = dev;
 
-	port = (struct veth_port*)netdev_priv(dev);
+	port = netdev_priv(dev);
 
 	/* Start the state machine on each connection on this vlan. If we're
 	 * the first dev to do so this will commence link negotiation */
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c
index e7030ce..da74db4 100644
--- a/drivers/net/lib8390.c
+++ b/drivers/net/lib8390.c
@@ -203,7 +203,7 @@ static void __NS8390_init(struct net_device *dev, int startp);
 static int __ei_open(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	if (dev->watchdog_timeo <= 0)
 		 dev->watchdog_timeo = TX_TIMEOUT;
@@ -231,7 +231,7 @@ static int __ei_open(struct net_device *dev)
  */
 static int __ei_close(struct net_device *dev)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned long flags;
 
 	/*
@@ -256,7 +256,7 @@ static int __ei_close(struct net_device *dev)
 static void __ei_tx_timeout(struct net_device *dev)
 {
 	unsigned long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int txsr, isr, tickssofar = jiffies - dev_trans_start(dev);
 	unsigned long flags;
 
@@ -303,7 +303,7 @@ static netdev_tx_t __ei_start_xmit(struct sk_buff *skb,
 				   struct net_device *dev)
 {
 	unsigned long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int send_length = skb->len, output_page;
 	unsigned long flags;
 	char buf[ETH_ZLEN];
@@ -592,7 +592,7 @@ static void ei_tx_err(struct net_device *dev)
 static void ei_tx_intr(struct net_device *dev)
 {
 	unsigned long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int status = ei_inb(e8390_base + EN0_TSR);
 
 	ei_outb_p(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */
@@ -675,7 +675,7 @@ static void ei_tx_intr(struct net_device *dev)
 static void ei_receive(struct net_device *dev)
 {
 	unsigned long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned char rxing_page, this_frame, next_frame;
 	unsigned short current_offset;
 	int rx_pkt_count = 0;
@@ -879,7 +879,7 @@ static void ei_rx_overrun(struct net_device *dev)
 static struct net_device_stats *__ei_get_stats(struct net_device *dev)
 {
 	unsigned long ioaddr = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned long flags;
 
 	/* If the card is stopped, just return the present stats. */
@@ -927,7 +927,7 @@ static void do_set_multicast_list(struct net_device *dev)
 {
 	unsigned long e8390_base = dev->base_addr;
 	int i;
-	struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI)))
 	{
@@ -981,7 +981,7 @@ static void do_set_multicast_list(struct net_device *dev)
 static void __ei_set_multicast_list(struct net_device *dev)
 {
 	unsigned long flags;
-	struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	spin_lock_irqsave(&ei_local->page_lock, flags);
 	do_set_multicast_list(dev);
@@ -998,7 +998,7 @@ static void __ei_set_multicast_list(struct net_device *dev)
 
 static void ethdev_setup(struct net_device *dev)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	if (ei_debug > 1)
 		printk(version);
 
@@ -1036,7 +1036,7 @@ static struct net_device *____alloc_ei_netdev(int size)
 static void __NS8390_init(struct net_device *dev, int startp)
 {
 	unsigned long e8390_base = dev->base_addr;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int i;
 	int endcfg = ei_local->word16
 	    ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0))
@@ -1099,7 +1099,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
 								int start_page)
 {
 	unsigned long e8390_base = dev->base_addr;
- 	struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev);
+ 	struct ei_device *ei_local __attribute((unused)) = netdev_priv(dev);
 
 	ei_outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD);
 
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
index e0b0ef1..30be8c6 100644
--- a/drivers/net/ne-h8300.c
+++ b/drivers/net/ne-h8300.c
@@ -86,7 +86,7 @@ static u32 reg_offset[16];
 
 static int __init init_reg_offset(struct net_device *dev,unsigned long base_addr)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	int i;
 	unsigned char bus_width;
 
@@ -218,7 +218,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
 	int start_page, stop_page;
 	int reg0, ret;
 	static unsigned version_printed;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned char bus_width;
 
 	if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
@@ -371,7 +371,7 @@ static int ne_close(struct net_device *dev)
 static void ne_reset_8390(struct net_device *dev)
 {
 	unsigned long reset_start_time = jiffies;
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 
 	if (ei_debug > 1)
 		printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies);
@@ -397,7 +397,7 @@ static void ne_reset_8390(struct net_device *dev)
 
 static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	/* This *shouldn't* happen. If it does, it's the last thing you'll see */
 
 	if (ei_status.dmaing)
@@ -437,7 +437,7 @@ static void ne_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, i
 
 static void ne_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 #ifdef NE_SANITY_CHECK
 	int xfer_count = count;
 #endif
@@ -507,7 +507,7 @@ static void ne_block_input(struct net_device *dev, int count, struct sk_buff *sk
 static void ne_block_output(struct net_device *dev, int count,
 		const unsigned char *buf, const int start_page)
 {
-	struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
+	struct ei_device *ei_local = netdev_priv(dev);
 	unsigned long dma_start;
 #ifdef NE_SANITY_CHECK
 	int retries = 0;
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 14f0955..2de52d1 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -515,7 +515,7 @@ static void xemaclite_update_address(struct net_local *drvdata,
  */
 static int xemaclite_set_mac_address(struct net_device *dev, void *address)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	struct sockaddr *addr = address;
 
 	if (netif_running(dev))
@@ -534,7 +534,7 @@ static int xemaclite_set_mac_address(struct net_device *dev, void *address)
  */
 static void xemaclite_tx_timeout(struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	unsigned long flags;
 
 	dev_err(&lp->ndev->dev, "Exceeded transmit timeout of %lu ms\n",
@@ -578,7 +578,7 @@ static void xemaclite_tx_timeout(struct net_device *dev)
  */
 static void xemaclite_tx_handler(struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 
 	dev->stats.tx_packets++;
 	if (lp->deferred_skb) {
@@ -605,7 +605,7 @@ static void xemaclite_tx_handler(struct net_device *dev)
  */
 static void xemaclite_rx_handler(struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	struct sk_buff *skb;
 	unsigned int align;
 	u32 len;
@@ -661,7 +661,7 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
 {
 	bool tx_complete = 0;
 	struct net_device *dev = dev_id;
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	void __iomem *base_addr = lp->base_addr;
 	u32 tx_status;
 
@@ -918,7 +918,7 @@ void xemaclite_adjust_link(struct net_device *ndev)
  */
 static int xemaclite_open(struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	int retval;
 
 	/* Just to be safe, stop the device first */
@@ -987,7 +987,7 @@ static int xemaclite_open(struct net_device *dev)
  */
 static int xemaclite_close(struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 
 	netif_stop_queue(dev);
 	xemaclite_disable_interrupts(lp);
@@ -1031,7 +1031,7 @@ static struct net_device_stats *xemaclite_get_stats(struct net_device *dev)
  */
 static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
 {
-	struct net_local *lp = (struct net_local *) netdev_priv(dev);
+	struct net_local *lp = netdev_priv(dev);
 	struct sk_buff *new_skb;
 	unsigned int len;
 	unsigned long flags;
@@ -1068,7 +1068,7 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)
 static void xemaclite_remove_ndev(struct net_device *ndev)
 {
 	if (ndev) {
-		struct net_local *lp = (struct net_local *) netdev_priv(ndev);
+		struct net_local *lp = netdev_priv(ndev);
 
 		if (lp->base_addr)
 			iounmap((void __iomem __force *) (lp->base_addr));
@@ -1245,7 +1245,7 @@ static int __devexit xemaclite_of_remove(struct platform_device *of_dev)
 	struct device *dev = &of_dev->dev;
 	struct net_device *ndev = dev_get_drvdata(dev);
 
-	struct net_local *lp = (struct net_local *) netdev_priv(ndev);
+	struct net_local *lp = netdev_priv(ndev);
 
 	/* Un-register the mii_bus, if configured */
 	if (lp->has_mdio) {
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 09/10] drivers/staging: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (7 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 08/10] drivers/net: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-16  7:20   ` Belisko Marek
  2010-11-15 21:12 ` [PATCH 10/10] net/atm: " Joe Perches
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Greg Kroah-Hartman, devel, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   |   54 ++++++++++----------
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c |    8 ++--
 drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c   |    8 ++--
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c      |   16 +++---
 drivers/staging/ft1000/ft1000-usb/ft1000_proc.c    |    6 +-
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c     |    2 +-
 drivers/staging/rtl8712/usb_intf.c                 |    2 +-
 7 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index eed7e94..588afd5 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -132,7 +132,7 @@ inline void ft1000_asic_write(struct net_device *dev, u16 offset, u16 value)
 //---------------------------------------------------------------------------
 static inline u16 ft1000_read_fifo_len(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 
 	if (info->AsicID == ELECTRABUZZ_ID) {
 		return (ft1000_read_reg(dev, FT1000_REG_UFIFO_STAT) - 16);
@@ -155,7 +155,7 @@ static inline u16 ft1000_read_fifo_len(struct net_device *dev)
 //---------------------------------------------------------------------------
 u16 ft1000_read_dpram(struct net_device * dev, int offset)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 	u16 data;
 
@@ -184,7 +184,7 @@ u16 ft1000_read_dpram(struct net_device * dev, int offset)
 static inline void ft1000_write_dpram(struct net_device *dev,
 					  int offset, u16 value)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 
 	// Provide mutual exclusive access while reading ASIC registers.
@@ -208,7 +208,7 @@ static inline void ft1000_write_dpram(struct net_device *dev,
 //---------------------------------------------------------------------------
 u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 	u16 data;
 
@@ -242,7 +242,7 @@ u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index)
 static inline void ft1000_write_dpram_mag_16(struct net_device *dev,
 						 int offset, u16 value, int Index)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 
 	// Provide mutual exclusive access while reading ASIC registers.
@@ -270,7 +270,7 @@ static inline void ft1000_write_dpram_mag_16(struct net_device *dev,
 //---------------------------------------------------------------------------
 u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 	u32 data;
 
@@ -298,7 +298,7 @@ u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset)
 //---------------------------------------------------------------------------
 void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	unsigned long flags;
 
 	// Provide mutual exclusive access while reading ASIC registers.
@@ -320,7 +320,7 @@ void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value)
 //---------------------------------------------------------------------------
 static void ft1000_enable_interrupts(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 tempword;
 
 	DEBUG(1, "ft1000_hw:ft1000_enable_interrupts()\n");
@@ -345,7 +345,7 @@ static void ft1000_enable_interrupts(struct net_device *dev)
 //---------------------------------------------------------------------------
 static void ft1000_disable_interrupts(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 tempword;
 
 	DEBUG(1, "ft1000_hw: ft1000_disable_interrupts()\n");
@@ -370,7 +370,7 @@ static void ft1000_disable_interrupts(struct net_device *dev)
 //---------------------------------------------------------------------------
 static void ft1000_reset_asic(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 tempword;
 
 	DEBUG(1, "ft1000_hw:ft1000_reset_asic called\n");
@@ -414,7 +414,7 @@ static void ft1000_reset_asic(struct net_device *dev)
 //---------------------------------------------------------------------------
 static int ft1000_reset_card(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 tempword;
 	int i;
 	unsigned long flags;
@@ -618,7 +618,7 @@ static void ft1000_hbchk(u_long data)
 	FT1000_INFO *info;
 	USHORT tempword;
 
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	if (info->CardReady == 1) {
 		// Perform dsp heartbeat check
@@ -831,7 +831,7 @@ static void ft1000_hbchk(u_long data)
 //---------------------------------------------------------------------------
 void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	int i;
 	u16 tempword;
 	unsigned long flags;
@@ -916,7 +916,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt
 //---------------------------------------------------------------------------
 BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 size;
 	u16 *ppseudohdr;
 	int i;
@@ -1009,7 +1009,7 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16
 //---------------------------------------------------------------------------
 void ft1000_proc_drvmsg(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 msgtype;
 	u16 tempword;
 	PMEDIAMSG pmediamsg;
@@ -1292,7 +1292,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
 //---------------------------------------------------------------------------
 int ft1000_parse_dpram_msg(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 doorbell;
 	u16 portid;
 	u16 nxtph;
@@ -1449,7 +1449,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev)
 //---------------------------------------------------------------------------
 static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 i;
 	u32 templong;
 	u16 tempword;
@@ -1596,7 +1596,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum)
 int ft1000_copy_up_pkt(struct net_device *dev)
 {
 	u16 tempword;
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 len;
 	struct sk_buff *skb;
 	u16 i;
@@ -1783,7 +1783,7 @@ int ft1000_copy_up_pkt(struct net_device *dev)
 //---------------------------------------------------------------------------
 int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	union {
 		PSEUDO_HDR blk;
 		u16 buff[sizeof(PSEUDO_HDR) >> 1];
@@ -1943,7 +1943,7 @@ int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len)
 
 static struct net_device_stats *ft1000_stats(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	return (&info->stats);
 }
 
@@ -1967,7 +1967,7 @@ static int ft1000_open(struct net_device *dev)
 
 static int ft1000_close(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 
 	DEBUG(0, "ft1000_hw: ft1000_close()\n");
 
@@ -1989,7 +1989,7 @@ static int ft1000_close(struct net_device *dev)
 
 static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u8 *pdata;
 
 	DEBUG(1, "ft1000_hw: ft1000_start_xmit()\n");
@@ -2026,7 +2026,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
 static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = (struct net_device *)dev_id;
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	u16 tempword;
 	u16 inttype;
 	int cnt;
@@ -2091,7 +2091,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
 
 void stop_ft1000_card(struct net_device *dev)
 {
-	FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
+	FT1000_INFO *info = netdev_priv(dev);
 	PPROV_RECORD ptr;
 //	int cnt;
 
@@ -2127,7 +2127,7 @@ static void ft1000_get_drvinfo(struct net_device *dev,
 				   struct ethtool_drvinfo *info)
 {
 	FT1000_INFO *ft_info;
-	ft_info = (FT1000_INFO *) netdev_priv(dev);
+	ft_info = netdev_priv(dev);
 
 	snprintf(info->driver, 32, "ft1000");
 	snprintf(info->bus_info, ETHTOOL_BUSINFO_LEN, "PCMCIA 0x%lx",
@@ -2139,7 +2139,7 @@ static void ft1000_get_drvinfo(struct net_device *dev,
 static u32 ft1000_get_link(struct net_device *dev)
 {
 	FT1000_INFO *info;
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 	return info->mediastate;
 }
 
@@ -2185,7 +2185,7 @@ struct net_device *init_ft1000_card(unsigned short irq, int port,
 	}
 
 	SET_NETDEV_DEV(dev, fdev);
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	memset(info, 0, sizeof(FT1000_INFO));
 
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
index b45de9b..935608e 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
@@ -65,7 +65,7 @@ int ft1000ReadProc(char *page, char **start, off_t off,
 	time_t delta;
 
 	dev = (struct net_device *)data;
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	if (off > 0) {
 		*eof = 1;
@@ -174,7 +174,7 @@ static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
 	struct net_device *dev = ptr;
 	FT1000_INFO *info;
 
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	switch (event) {
 	case NETDEV_CHANGENAME:
@@ -195,7 +195,7 @@ void ft1000InitProc(struct net_device *dev)
 {
 	FT1000_INFO *info;
 
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	info->proc_ft1000 = proc_mkdir(FT1000_PROC, init_net.proc_net);
 	create_proc_read_entry(dev->name, 0644, info->proc_ft1000,
@@ -208,7 +208,7 @@ void ft1000CleanupProc(struct net_device *dev)
 {
 	FT1000_INFO *info;
 
-	info = (FT1000_INFO *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 	remove_proc_entry(dev->name, info->proc_ft1000);
 	remove_proc_entry(FT1000_PROC, init_net.proc_net);
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
index 197b3fb..2135455 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
@@ -423,7 +423,7 @@ static int ft1000_ChOpen (struct inode *Inode, struct file *File)
 
     if ( pdevobj[num] != NULL )
         //info = (struct ft1000_info *)(pdevobj[num]->net->priv);
-		info = (struct ft1000_info *)netdev_priv(pdevobj[num]->net);
+		info = netdev_priv(pdevobj[num]->net);
     else
     {
         DEBUG("ft1000_ChOpen: can not find device object %d\n", num);
@@ -488,7 +488,7 @@ static unsigned int ft1000_ChPoll(struct file *file, poll_table *wait)
         return (-EBADF);
     }
 
-	info = (struct ft1000_info *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
     // Search for matching file object
     for (i=0; i<MAX_NUM_APP; i++) {
@@ -560,7 +560,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
     //DEBUG("FT1000:ft1000_ChIoctl:Command = 0x%x Argument = 0x%8x\n", Command, (u32)Argument);
 
     dev = File->private_data;
-	info = (struct ft1000_info *) netdev_priv(dev);
+	info = netdev_priv(dev);
     ft1000dev = info->pFt1000Dev;
     cmd = _IOC_NR(Command);
     //DEBUG("FT1000:ft1000_ChIoctl:cmd = 0x%x\n", cmd);
@@ -900,7 +900,7 @@ static int ft1000_ChRelease (struct inode *Inode, struct file *File)
     DEBUG("ft1000_ChRelease called\n");
 
     dev = File->private_data;
-	info = (struct ft1000_info *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
     if (ft1000_flarion_cnt == 0) {
         info->appcnt--;
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index b41884e..1ca01e2 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -786,7 +786,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
 	return -ENOMEM;
     }
 
-	pInfo = (struct ft1000_info *) netdev_priv(netdev);
+	pInfo = netdev_priv(netdev);
 
     //DEBUG("init_ft1000_netdev: gFt1000Info=%x, netdev=%x, ft1000dev=%x\n", gFt1000Info, netdev, ft1000dev);
 
@@ -1345,7 +1345,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info)
 //---------------------------------------------------------------------------
 static int ft1000_open (struct net_device *dev)
 {
-	struct ft1000_info *pInfo = (struct ft1000_info *)netdev_priv(dev);
+	struct ft1000_info *pInfo = netdev_priv(dev);
     struct timeval tv; //mbelian
 	int ret;
 
@@ -1386,7 +1386,7 @@ static int ft1000_open (struct net_device *dev)
 //---------------------------------------------------------------------------
 int ft1000_close(struct net_device *net)
 {
-	struct ft1000_info *pInfo = (struct ft1000_info *) netdev_priv(net);
+	struct ft1000_info *pInfo = netdev_priv(net);
     struct ft1000_device *ft1000dev = pInfo->pFt1000Dev;
 
     //DEBUG ("ft1000_close: netdev->refcnt=%d\n", net->refcnt);
@@ -1409,7 +1409,7 @@ int ft1000_close(struct net_device *net)
 
 static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev)
 {
-	struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
+	struct ft1000_info *info = netdev_priv(dev);
 
 	return &(info->stats); //mbelian
 }
@@ -1435,7 +1435,7 @@ Jim
 static int ft1000_chkcard (struct ft1000_device *dev) {
     u16 tempword;
     u16 status;
-	struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+	struct ft1000_info *info = netdev_priv(dev->net);
 
     if (info->fCondResetPend)
     {
@@ -1535,7 +1535,7 @@ static bool ft1000_receive_cmd (struct ft1000_device *dev, u16 *pbuffer, int max
 static int ft1000_dsp_prov(void *arg)
 {
     struct ft1000_device *dev = (struct ft1000_device *)arg;
-	struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+	struct ft1000_info *info = netdev_priv(dev->net);
     u16 tempword;
     u16 len;
     u16 i=0;
@@ -1618,7 +1618,7 @@ static int ft1000_dsp_prov(void *arg)
 
 
 static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) {
-	struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+	struct ft1000_info *info = netdev_priv(dev->net);
     u16 msgtype;
     u16 tempword;
 	struct media_msg *pmediamsg;
@@ -1901,7 +1901,7 @@ out:
 int ft1000_poll(void* dev_id) {
 
     struct ft1000_device *dev = (struct ft1000_device *)dev_id;
-	struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+	struct ft1000_info *info = netdev_priv(dev->net);
 
     u16 tempword;
     u16 status;
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
index f665640..105846d 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
@@ -65,7 +65,7 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
   time_t delta;
 
   dev = (struct net_device *) data;
-	info = (struct ft1000_info *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
   if (off > 0)
     {
@@ -172,7 +172,7 @@ ft1000NotifyProc (struct notifier_block *this, unsigned long event, void *ptr)
 	struct ft1000_info *info;
   struct proc_dir_entry *ft1000_proc_file;
 
-info = (struct ft1000_info *) netdev_priv(dev);
+info = netdev_priv(dev);
 
 
   switch (event)
@@ -198,7 +198,7 @@ ft1000InitProc (struct net_device *dev)
 {
 	struct ft1000_info *info;
   struct proc_dir_entry *ft1000_proc_file;
-	info = (struct ft1000_info *) netdev_priv(dev);
+	info = netdev_priv(dev);
 
 
   info->ft1000_proc_dir = proc_mkdir (FT1000_PROC_DIR, FTNET_PROC);
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
index 99e3339..f87f928e 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
@@ -163,7 +163,7 @@ static int ft1000_probe(struct usb_interface *interface,
 	if (ret)
 		goto err_load;
 
-	pft1000info = (struct ft1000_info *) netdev_priv(ft1000dev->net);
+	pft1000info = netdev_priv(ft1000dev->net);
 
 	DEBUG("In probe: pft1000info=%p\n", pft1000info);
 	ret = dsp_reload(ft1000dev);
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index f1f0c63..a692ee8 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -527,7 +527,7 @@ error:
 static void r871xu_dev_remove(struct usb_interface *pusb_intf)
 {
 	struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
-	struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev);
+	struct _adapter *padapter = netdev_priv(pnetdev);
 	struct usb_device *udev = interface_to_usbdev(pusb_intf);
 
 	if (padapter) {
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 10/10] net/atm: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
                   ` (8 preceding siblings ...)
  2010-11-15 21:12 ` [PATCH 09/10] drivers/staging: " Joe Perches
@ 2010-11-15 21:12 ` Joe Perches
  2010-11-17 18:45   ` David Miller
  9 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-15 21:12 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: David S. Miller, netdev, linux-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/atm/br2684.c |    2 +-
 net/atm/lec.c    |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index ad2b232..fce2eae 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -97,7 +97,7 @@ static LIST_HEAD(br2684_devs);
 
 static inline struct br2684_dev *BRPRIV(const struct net_device *net_dev)
 {
-	return (struct br2684_dev *)netdev_priv(net_dev);
+	return netdev_priv(net_dev);
 }
 
 static inline struct net_device *list_entry_brdev(const struct list_head *le)
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 181d70c..179e04b 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -816,8 +816,7 @@ static int lec_mcast_attach(struct atm_vcc *vcc, int arg)
 	if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg])
 		return -EINVAL;
 	vcc->proto_data = dev_lec[arg];
-	return lec_mcast_make((struct lec_priv *)netdev_priv(dev_lec[arg]),
-				vcc);
+	return lec_mcast_make(netdev_priv(dev_lec[arg]), vcc);
 }
 
 /* Initialize device. */
-- 
1.7.3.1.g432b3.dirty


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH 07/10] drivers/net/vxge: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 07/10] drivers/net/vxge: " Joe Perches
@ 2010-11-15 22:51   ` Jon Mason
  2010-11-17 18:44   ` David Miller
  1 sibling, 0 replies; 28+ messages in thread
From: Jon Mason @ 2010-11-15 22:51 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jiri Kosina, Ramkrishna Vepa, Sivakumar Subramani,
	Sreenivasa Honnur, netdev, linux-kernel

On Mon, Nov 15, 2010 at 01:12:30PM -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>

Looks good to me.

Acked-by: Jon Mason <jon.mason@exar.com>

> ---
>  drivers/net/vxge/vxge-ethtool.c |   26 +++++++++++++-------------
>  drivers/net/vxge/vxge-main.c    |   26 +++++++++++++-------------
>  2 files changed, 26 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c
> index 09f721e..bc9bd10 100644
> --- a/drivers/net/vxge/vxge-ethtool.c
> +++ b/drivers/net/vxge/vxge-ethtool.c
> @@ -80,7 +80,7 @@ static int vxge_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
>  static void vxge_ethtool_gdrvinfo(struct net_device *dev,
>  				  struct ethtool_drvinfo *info)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	strlcpy(info->driver, VXGE_DRIVER_NAME, sizeof(VXGE_DRIVER_NAME));
>  	strlcpy(info->version, DRV_VERSION, sizeof(DRV_VERSION));
>  	strlcpy(info->fw_version, vdev->fw_version, VXGE_HW_FW_STRLEN);
> @@ -108,7 +108,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
>  	enum vxge_hw_status status;
>  	u64 reg;
>  	u64 *reg_space = (u64 *)space;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	regs->len = sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
> @@ -144,7 +144,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
>   */
>  static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
> @@ -166,7 +166,7 @@ static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
>  static void vxge_ethtool_getpause_data(struct net_device *dev,
>  				       struct ethtool_pauseparam *ep)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_getpause_data(hldev, 0, &ep->tx_pause, &ep->rx_pause);
> @@ -185,7 +185,7 @@ static void vxge_ethtool_getpause_data(struct net_device *dev,
>  static int vxge_ethtool_setpause_data(struct net_device *dev,
>  				      struct ethtool_pauseparam *ep)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_setpause_data(hldev, 0, ep->tx_pause, ep->rx_pause);
> @@ -203,7 +203,7 @@ static void vxge_get_ethtool_stats(struct net_device *dev,
>  	enum vxge_hw_status status;
>  	enum vxge_hw_status swstatus;
>  	struct vxge_vpath *vpath = NULL;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct __vxge_hw_device *hldev = vdev->devh;
>  	struct vxge_hw_xmac_stats *xmac_stats;
>  	struct vxge_hw_device_stats_sw_info *sw_stats;
> @@ -572,7 +572,7 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
>  {
>  	int stat_size = 0;
>  	int i, j;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	switch (stringset) {
>  	case ETH_SS_STATS:
>  		vxge_add_string("VPATH STATISTICS%s\t\t\t",
> @@ -1059,21 +1059,21 @@ static void vxge_ethtool_get_strings(struct net_device *dev, u32 stringset,
>  
>  static int vxge_ethtool_get_regs_len(struct net_device *dev)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	return sizeof(struct vxge_hw_vpath_reg) * vdev->no_of_vpath;
>  }
>  
>  static u32 vxge_get_rx_csum(struct net_device *dev)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	return vdev->rx_csum;
>  }
>  
>  static int vxge_set_rx_csum(struct net_device *dev, u32 data)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	if (data)
>  		vdev->rx_csum = 1;
> @@ -1095,7 +1095,7 @@ static int vxge_ethtool_op_set_tso(struct net_device *dev, u32 data)
>  
>  static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	switch (sset) {
>  	case ETH_SS_STATS:
> @@ -1114,7 +1114,7 @@ static int vxge_ethtool_get_sset_count(struct net_device *dev, int sset)
>  
>  static int vxge_set_flags(struct net_device *dev, u32 data)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	enum vxge_hw_status status;
>  
>  	if (data & ~ETH_FLAG_RXHASH)
> @@ -1148,7 +1148,7 @@ static int vxge_set_flags(struct net_device *dev, u32 data)
>  
>  static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms)
>  {
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) {
>  		printk(KERN_INFO "Single Function Mode is required to flash the"
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index 22c7d79..5cba4a6 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -153,7 +153,7 @@ static void
>  vxge_callback_link_up(struct __vxge_hw_device *hldev)
>  {
>  	struct net_device *dev = hldev->ndev;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
>  		vdev->ndev->name, __func__, __LINE__);
> @@ -177,7 +177,7 @@ static void
>  vxge_callback_link_down(struct __vxge_hw_device *hldev)
>  {
>  	struct net_device *dev = hldev->ndev;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  
>  	vxge_debug_entryexit(VXGE_TRACE,
>  		"%s: %s:%d", vdev->ndev->name, __func__, __LINE__);
> @@ -787,7 +787,7 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev)
>  		return NETDEV_TX_OK;
>  	}
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  
>  	if (unlikely(!is_vxge_card_up(vdev))) {
>  		vxge_debug_tx(VXGE_ERR,
> @@ -1052,7 +1052,7 @@ static void vxge_set_multicast(struct net_device *dev)
>  	vxge_debug_entryexit(VXGE_TRACE,
>  		"%s:%d", __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  	hldev = (struct __vxge_hw_device  *)vdev->devh;
>  
>  	if (unlikely(!is_vxge_card_up(vdev)))
> @@ -1209,7 +1209,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  	hldev = vdev->devh;
>  
>  	if (!is_valid_ether_addr(addr->sa_data))
> @@ -1671,7 +1671,7 @@ static void vxge_netpoll(struct net_device *dev)
>  	struct __vxge_hw_device *hldev;
>  	struct vxgedev *vdev;
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  	hldev = pci_get_drvdata(vdev->pdev);
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
> @@ -2581,7 +2581,7 @@ vxge_open(struct net_device *dev)
>  	vxge_debug_entryexit(VXGE_TRACE,
>  		"%s: %s:%d", dev->name, __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  	hldev = pci_get_drvdata(vdev->pdev);
>  	function_mode = vdev->config.device_hw_info.function_mode;
>  
> @@ -2809,7 +2809,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
>  	vxge_debug_entryexit(VXGE_TRACE, "%s: %s:%d",
>  		dev->name, __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  	hldev = pci_get_drvdata(vdev->pdev);
>  
>  	if (unlikely(!is_vxge_card_up(vdev)))
> @@ -3138,7 +3138,7 @@ vxge_tx_watchdog(struct net_device *dev)
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  
>  	vdev->cric_err_event = VXGE_HW_EVENT_RESET_START;
>  
> @@ -3166,7 +3166,7 @@ vxge_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  
>  	vpath = &vdev->vpaths[0];
>  	if ((NULL == grp) && (vpath->is_open)) {
> @@ -3215,7 +3215,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
>  	struct vxge_vpath *vpath;
>  	int vp_id;
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  
>  	/* Add these vlan to the vid table */
>  	for (vp_id = 0; vp_id < vdev->no_of_vpath; vp_id++) {
> @@ -3242,7 +3242,7 @@ vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
>  
>  	vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>  
> -	vdev = (struct vxgedev *)netdev_priv(dev);
> +	vdev = netdev_priv(dev);
>  
>  	vlan_group_set_device(vdev->vlgrp, vid, NULL);
>  
> @@ -3475,7 +3475,7 @@ vxge_callback_crit_err(struct __vxge_hw_device *hldev,
>  			enum vxge_hw_event type, u64 vp_id)
>  {
>  	struct net_device *dev = hldev->ndev;
> -	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +	struct vxgedev *vdev = netdev_priv(dev);
>  	struct vxge_vpath *vpath = NULL;
>  	int vpath_idx;
>  
> -- 
> 1.7.3.1.g432b3.dirty
> 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 09/10] drivers/staging: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 09/10] drivers/staging: " Joe Perches
@ 2010-11-16  7:20   ` Belisko Marek
  2010-11-16  7:30     ` Joe Perches
  0 siblings, 1 reply; 28+ messages in thread
From: Belisko Marek @ 2010-11-16  7:20 UTC (permalink / raw)
  To: Joe Perches; +Cc: Jiri Kosina, devel, Greg Kroah-Hartman, linux-kernel

Hi

On Mon, Nov 15, 2010 at 10:12 PM, Joe Perches <joe@perches.com> wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   |   54 ++++++++++----------
>  drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c |    8 ++--
>  drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c   |    8 ++--
>  drivers/staging/ft1000/ft1000-usb/ft1000_hw.c      |   16 +++---
>  drivers/staging/ft1000/ft1000-usb/ft1000_proc.c    |    6 +-
>  drivers/staging/ft1000/ft1000-usb/ft1000_usb.c     |    2 +-
>  drivers/staging/rtl8712/usb_intf.c                 |    2 +-
>  7 files changed, 48 insertions(+), 48 deletions(-)
Shouldn't be patch divided to some logical parts?
This patch fix ft1000 drivers also rtl8712. Is this correct?

If I do: grep -r -n 'netdev_priv' drivers/staging/*/*[ch]

there is a more netdev_priv occurences ;)
>
> diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
> index eed7e94..588afd5 100644
> --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
> +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
> @@ -132,7 +132,7 @@ inline void ft1000_asic_write(struct net_device *dev, u16 offset, u16 value)
>  //---------------------------------------------------------------------------
>  static inline u16 ft1000_read_fifo_len(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>
>        if (info->AsicID == ELECTRABUZZ_ID) {
>                return (ft1000_read_reg(dev, FT1000_REG_UFIFO_STAT) - 16);
> @@ -155,7 +155,7 @@ static inline u16 ft1000_read_fifo_len(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  u16 ft1000_read_dpram(struct net_device * dev, int offset)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>        u16 data;
>
> @@ -184,7 +184,7 @@ u16 ft1000_read_dpram(struct net_device * dev, int offset)
>  static inline void ft1000_write_dpram(struct net_device *dev,
>                                          int offset, u16 value)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>
>        // Provide mutual exclusive access while reading ASIC registers.
> @@ -208,7 +208,7 @@ static inline void ft1000_write_dpram(struct net_device *dev,
>  //---------------------------------------------------------------------------
>  u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>        u16 data;
>
> @@ -242,7 +242,7 @@ u16 ft1000_read_dpram_mag_16(struct net_device *dev, int offset, int Index)
>  static inline void ft1000_write_dpram_mag_16(struct net_device *dev,
>                                                 int offset, u16 value, int Index)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>
>        // Provide mutual exclusive access while reading ASIC registers.
> @@ -270,7 +270,7 @@ static inline void ft1000_write_dpram_mag_16(struct net_device *dev,
>  //---------------------------------------------------------------------------
>  u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>        u32 data;
>
> @@ -298,7 +298,7 @@ u32 ft1000_read_dpram_mag_32(struct net_device *dev, int offset)
>  //---------------------------------------------------------------------------
>  void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        unsigned long flags;
>
>        // Provide mutual exclusive access while reading ASIC registers.
> @@ -320,7 +320,7 @@ void ft1000_write_dpram_mag_32(struct net_device *dev, int offset, u32 value)
>  //---------------------------------------------------------------------------
>  static void ft1000_enable_interrupts(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 tempword;
>
>        DEBUG(1, "ft1000_hw:ft1000_enable_interrupts()\n");
> @@ -345,7 +345,7 @@ static void ft1000_enable_interrupts(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  static void ft1000_disable_interrupts(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 tempword;
>
>        DEBUG(1, "ft1000_hw: ft1000_disable_interrupts()\n");
> @@ -370,7 +370,7 @@ static void ft1000_disable_interrupts(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  static void ft1000_reset_asic(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 tempword;
>
>        DEBUG(1, "ft1000_hw:ft1000_reset_asic called\n");
> @@ -414,7 +414,7 @@ static void ft1000_reset_asic(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  static int ft1000_reset_card(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 tempword;
>        int i;
>        unsigned long flags;
> @@ -618,7 +618,7 @@ static void ft1000_hbchk(u_long data)
>        FT1000_INFO *info;
>        USHORT tempword;
>
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        if (info->CardReady == 1) {
>                // Perform dsp heartbeat check
> @@ -831,7 +831,7 @@ static void ft1000_hbchk(u_long data)
>  //---------------------------------------------------------------------------
>  void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qtype)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        int i;
>        u16 tempword;
>        unsigned long flags;
> @@ -916,7 +916,7 @@ void ft1000_send_cmd (struct net_device *dev, u16 *ptempbuffer, int size, u16 qt
>  //---------------------------------------------------------------------------
>  BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16 *pnxtph)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 size;
>        u16 *ppseudohdr;
>        int i;
> @@ -1009,7 +1009,7 @@ BOOLEAN ft1000_receive_cmd(struct net_device *dev, u16 * pbuffer, int maxsz, u16
>  //---------------------------------------------------------------------------
>  void ft1000_proc_drvmsg(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 msgtype;
>        u16 tempword;
>        PMEDIAMSG pmediamsg;
> @@ -1292,7 +1292,7 @@ void ft1000_proc_drvmsg(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  int ft1000_parse_dpram_msg(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 doorbell;
>        u16 portid;
>        u16 nxtph;
> @@ -1449,7 +1449,7 @@ int ft1000_parse_dpram_msg(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 i;
>        u32 templong;
>        u16 tempword;
> @@ -1596,7 +1596,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum)
>  int ft1000_copy_up_pkt(struct net_device *dev)
>  {
>        u16 tempword;
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 len;
>        struct sk_buff *skb;
>        u16 i;
> @@ -1783,7 +1783,7 @@ int ft1000_copy_up_pkt(struct net_device *dev)
>  //---------------------------------------------------------------------------
>  int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        union {
>                PSEUDO_HDR blk;
>                u16 buff[sizeof(PSEUDO_HDR) >> 1];
> @@ -1943,7 +1943,7 @@ int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len)
>
>  static struct net_device_stats *ft1000_stats(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        return (&info->stats);
>  }
>
> @@ -1967,7 +1967,7 @@ static int ft1000_open(struct net_device *dev)
>
>  static int ft1000_close(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>
>        DEBUG(0, "ft1000_hw: ft1000_close()\n");
>
> @@ -1989,7 +1989,7 @@ static int ft1000_close(struct net_device *dev)
>
>  static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u8 *pdata;
>
>        DEBUG(1, "ft1000_hw: ft1000_start_xmit()\n");
> @@ -2026,7 +2026,7 @@ static int ft1000_start_xmit(struct sk_buff *skb, struct net_device *dev)
>  static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
>  {
>        struct net_device *dev = (struct net_device *)dev_id;
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        u16 tempword;
>        u16 inttype;
>        int cnt;
> @@ -2091,7 +2091,7 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
>
>  void stop_ft1000_card(struct net_device *dev)
>  {
> -       FT1000_INFO *info = (FT1000_INFO *) netdev_priv(dev);
> +       FT1000_INFO *info = netdev_priv(dev);
>        PPROV_RECORD ptr;
>  //     int cnt;
>
> @@ -2127,7 +2127,7 @@ static void ft1000_get_drvinfo(struct net_device *dev,
>                                   struct ethtool_drvinfo *info)
>  {
>        FT1000_INFO *ft_info;
> -       ft_info = (FT1000_INFO *) netdev_priv(dev);
> +       ft_info = netdev_priv(dev);
>
>        snprintf(info->driver, 32, "ft1000");
>        snprintf(info->bus_info, ETHTOOL_BUSINFO_LEN, "PCMCIA 0x%lx",
> @@ -2139,7 +2139,7 @@ static void ft1000_get_drvinfo(struct net_device *dev,
>  static u32 ft1000_get_link(struct net_device *dev)
>  {
>        FT1000_INFO *info;
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>        return info->mediastate;
>  }
>
> @@ -2185,7 +2185,7 @@ struct net_device *init_ft1000_card(unsigned short irq, int port,
>        }
>
>        SET_NETDEV_DEV(dev, fdev);
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        memset(info, 0, sizeof(FT1000_INFO));
>
> diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
> index b45de9b..935608e 100644
> --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
> +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
> @@ -65,7 +65,7 @@ int ft1000ReadProc(char *page, char **start, off_t off,
>        time_t delta;
>
>        dev = (struct net_device *)data;
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        if (off > 0) {
>                *eof = 1;
> @@ -174,7 +174,7 @@ static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
>        struct net_device *dev = ptr;
>        FT1000_INFO *info;
>
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        switch (event) {
>        case NETDEV_CHANGENAME:
> @@ -195,7 +195,7 @@ void ft1000InitProc(struct net_device *dev)
>  {
>        FT1000_INFO *info;
>
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        info->proc_ft1000 = proc_mkdir(FT1000_PROC, init_net.proc_net);
>        create_proc_read_entry(dev->name, 0644, info->proc_ft1000,
> @@ -208,7 +208,7 @@ void ft1000CleanupProc(struct net_device *dev)
>  {
>        FT1000_INFO *info;
>
> -       info = (FT1000_INFO *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>        remove_proc_entry(dev->name, info->proc_ft1000);
>        remove_proc_entry(FT1000_PROC, init_net.proc_net);
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
> index 197b3fb..2135455 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
> @@ -423,7 +423,7 @@ static int ft1000_ChOpen (struct inode *Inode, struct file *File)
>
>     if ( pdevobj[num] != NULL )
>         //info = (struct ft1000_info *)(pdevobj[num]->net->priv);
> -               info = (struct ft1000_info *)netdev_priv(pdevobj[num]->net);
> +               info = netdev_priv(pdevobj[num]->net);
>     else
>     {
>         DEBUG("ft1000_ChOpen: can not find device object %d\n", num);
> @@ -488,7 +488,7 @@ static unsigned int ft1000_ChPoll(struct file *file, poll_table *wait)
>         return (-EBADF);
>     }
>
> -       info = (struct ft1000_info *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>     // Search for matching file object
>     for (i=0; i<MAX_NUM_APP; i++) {
> @@ -560,7 +560,7 @@ static long ft1000_ChIoctl (struct file *File, unsigned int Command,
>     //DEBUG("FT1000:ft1000_ChIoctl:Command = 0x%x Argument = 0x%8x\n", Command, (u32)Argument);
>
>     dev = File->private_data;
> -       info = (struct ft1000_info *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>     ft1000dev = info->pFt1000Dev;
>     cmd = _IOC_NR(Command);
>     //DEBUG("FT1000:ft1000_ChIoctl:cmd = 0x%x\n", cmd);
> @@ -900,7 +900,7 @@ static int ft1000_ChRelease (struct inode *Inode, struct file *File)
>     DEBUG("ft1000_ChRelease called\n");
>
>     dev = File->private_data;
> -       info = (struct ft1000_info *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>     if (ft1000_flarion_cnt == 0) {
>         info->appcnt--;
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
> index b41884e..1ca01e2 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
> @@ -786,7 +786,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
>        return -ENOMEM;
>     }
>
> -       pInfo = (struct ft1000_info *) netdev_priv(netdev);
> +       pInfo = netdev_priv(netdev);
>
>     //DEBUG("init_ft1000_netdev: gFt1000Info=%x, netdev=%x, ft1000dev=%x\n", gFt1000Info, netdev, ft1000dev);
>
> @@ -1345,7 +1345,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info)
>  //---------------------------------------------------------------------------
>  static int ft1000_open (struct net_device *dev)
>  {
> -       struct ft1000_info *pInfo = (struct ft1000_info *)netdev_priv(dev);
> +       struct ft1000_info *pInfo = netdev_priv(dev);
>     struct timeval tv; //mbelian
>        int ret;
>
> @@ -1386,7 +1386,7 @@ static int ft1000_open (struct net_device *dev)
>  //---------------------------------------------------------------------------
>  int ft1000_close(struct net_device *net)
>  {
> -       struct ft1000_info *pInfo = (struct ft1000_info *) netdev_priv(net);
> +       struct ft1000_info *pInfo = netdev_priv(net);
>     struct ft1000_device *ft1000dev = pInfo->pFt1000Dev;
>
>     //DEBUG ("ft1000_close: netdev->refcnt=%d\n", net->refcnt);
> @@ -1409,7 +1409,7 @@ int ft1000_close(struct net_device *net)
>
>  static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev)
>  {
> -       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
> +       struct ft1000_info *info = netdev_priv(dev);
>
>        return &(info->stats); //mbelian
>  }
> @@ -1435,7 +1435,7 @@ Jim
>  static int ft1000_chkcard (struct ft1000_device *dev) {
>     u16 tempword;
>     u16 status;
> -       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
> +       struct ft1000_info *info = netdev_priv(dev->net);
>
>     if (info->fCondResetPend)
>     {
> @@ -1535,7 +1535,7 @@ static bool ft1000_receive_cmd (struct ft1000_device *dev, u16 *pbuffer, int max
>  static int ft1000_dsp_prov(void *arg)
>  {
>     struct ft1000_device *dev = (struct ft1000_device *)arg;
> -       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
> +       struct ft1000_info *info = netdev_priv(dev->net);
>     u16 tempword;
>     u16 len;
>     u16 i=0;
> @@ -1618,7 +1618,7 @@ static int ft1000_dsp_prov(void *arg)
>
>
>  static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) {
> -       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
> +       struct ft1000_info *info = netdev_priv(dev->net);
>     u16 msgtype;
>     u16 tempword;
>        struct media_msg *pmediamsg;
> @@ -1901,7 +1901,7 @@ out:
>  int ft1000_poll(void* dev_id) {
>
>     struct ft1000_device *dev = (struct ft1000_device *)dev_id;
> -       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
> +       struct ft1000_info *info = netdev_priv(dev->net);
>
>     u16 tempword;
>     u16 status;
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
> index f665640..105846d 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
> @@ -65,7 +65,7 @@ ft1000ReadProc (char *page, char **start, off_t off, int count, int *eof,
>   time_t delta;
>
>   dev = (struct net_device *) data;
> -       info = (struct ft1000_info *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>   if (off > 0)
>     {
> @@ -172,7 +172,7 @@ ft1000NotifyProc (struct notifier_block *this, unsigned long event, void *ptr)
>        struct ft1000_info *info;
>   struct proc_dir_entry *ft1000_proc_file;
>
> -info = (struct ft1000_info *) netdev_priv(dev);
> +info = netdev_priv(dev);
>
>
>   switch (event)
> @@ -198,7 +198,7 @@ ft1000InitProc (struct net_device *dev)
>  {
>        struct ft1000_info *info;
>   struct proc_dir_entry *ft1000_proc_file;
> -       info = (struct ft1000_info *) netdev_priv(dev);
> +       info = netdev_priv(dev);
>
>
>   info->ft1000_proc_dir = proc_mkdir (FT1000_PROC_DIR, FTNET_PROC);
> diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> index 99e3339..f87f928e 100644
> --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
> @@ -163,7 +163,7 @@ static int ft1000_probe(struct usb_interface *interface,
>        if (ret)
>                goto err_load;
>
> -       pft1000info = (struct ft1000_info *) netdev_priv(ft1000dev->net);
> +       pft1000info = netdev_priv(ft1000dev->net);
>
>        DEBUG("In probe: pft1000info=%p\n", pft1000info);
>        ret = dsp_reload(ft1000dev);
> diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
> index f1f0c63..a692ee8 100644
> --- a/drivers/staging/rtl8712/usb_intf.c
> +++ b/drivers/staging/rtl8712/usb_intf.c
> @@ -527,7 +527,7 @@ error:
>  static void r871xu_dev_remove(struct usb_interface *pusb_intf)
>  {
>        struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
> -       struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev);
> +       struct _adapter *padapter = netdev_priv(pnetdev);
>        struct usb_device *udev = interface_to_usbdev(pusb_intf);
>
>        if (padapter) {
> --
> 1.7.3.1.g432b3.dirty
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
>

thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 09/10] drivers/staging: Remove unnecessary casts of netdev_priv
  2010-11-16  7:20   ` Belisko Marek
@ 2010-11-16  7:30     ` Joe Perches
  2010-11-16  7:37       ` Belisko Marek
  0 siblings, 1 reply; 28+ messages in thread
From: Joe Perches @ 2010-11-16  7:30 UTC (permalink / raw)
  To: Belisko Marek; +Cc: Jiri Kosina, devel, Greg Kroah-Hartman, linux-kernel

On Tue, 2010-11-16 at 08:20 +0100, Belisko Marek wrote:
> On Mon, Nov 15, 2010 at 10:12 PM, Joe Perches <joe@perches.com> wrote:
> > Signed-off-by: Joe Perches <joe@perches.com>
> If I do: grep -r -n 'netdev_priv' drivers/staging/*/*[ch]

Try:

$ grep -rP --include=*.[ch] "=\s*\([^\*]+\*\s*\)\s*netdev_priv" drivers/staging

> there is a more netdev_priv occurences ;)

I'm sure there are, but probably not assigns.
If you find more unnecessary casts, by all means submit them.

cheers, Joe


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 09/10] drivers/staging: Remove unnecessary casts of netdev_priv
  2010-11-16  7:30     ` Joe Perches
@ 2010-11-16  7:37       ` Belisko Marek
  0 siblings, 0 replies; 28+ messages in thread
From: Belisko Marek @ 2010-11-16  7:37 UTC (permalink / raw)
  To: Joe Perches; +Cc: Jiri Kosina, devel, Greg Kroah-Hartman, linux-kernel

On Tue, Nov 16, 2010 at 8:30 AM, Joe Perches <joe@perches.com> wrote:
> On Tue, 2010-11-16 at 08:20 +0100, Belisko Marek wrote:
>> On Mon, Nov 15, 2010 at 10:12 PM, Joe Perches <joe@perches.com> wrote:
>> > Signed-off-by: Joe Perches <joe@perches.com>
>> If I do: grep -r -n 'netdev_priv' drivers/staging/*/*[ch]
>
> Try:
>
> $ grep -rP --include=*.[ch] "=\s*\([^\*]+\*\s*\)\s*netdev_priv" drivers/staging
>
>> there is a more netdev_priv occurences ;)
>
> I'm sure there are, but probably not assigns.
Right. Just want to be sure ;)
> If you find more unnecessary casts, by all means submit them.

>
> cheers, Joe
>
>

thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 06/10] drivers/net/usb: " Joe Perches
@ 2010-11-16 17:59   ` Petko Manolov
  2010-11-17 18:45     ` David Miller
  2010-11-17 18:40   ` David Miller
  1 sibling, 1 reply; 28+ messages in thread
From: Petko Manolov @ 2010-11-16 17:59 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jiri Kosina, Petko Manolov, Greg Kroah-Hartman, linux-usb,
	netdev, linux-kernel

ACK! :-)


 		Petko


On Mon, 15 Nov 2010, Joe Perches wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> drivers/net/usb/pegasus.c |    4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
> index 6710f093..ef36676 100644
> --- a/drivers/net/usb/pegasus.c
> +++ b/drivers/net/usb/pegasus.c
> @@ -359,7 +359,7 @@ fail:
>
> static int mdio_read(struct net_device *dev, int phy_id, int loc)
> {
> -	pegasus_t *pegasus = (pegasus_t *) netdev_priv(dev);
> +	pegasus_t *pegasus = netdev_priv(dev);
> 	u16 res;
>
> 	read_mii_word(pegasus, phy_id, loc, &res);
> @@ -397,7 +397,7 @@ fail:
>
> static void mdio_write(struct net_device *dev, int phy_id, int loc, int val)
> {
> -	pegasus_t *pegasus = (pegasus_t *) netdev_priv(dev);
> +	pegasus_t *pegasus = netdev_priv(dev);
>
> 	write_mii_word(pegasus, phy_id, loc, val);
> }
> -- 
> 1.7.3.1.g432b3.dirty
>
>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 01/10] drivers/isdn/i4l: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 01/10] drivers/isdn/i4l: " Joe Perches
@ 2010-11-17 18:39   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:39 UTC (permalink / raw)
  To: joe; +Cc: trivial, isdn, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:24 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 02/10] drivers/net/bonding: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 02/10] drivers/net/bonding: " Joe Perches
@ 2010-11-17 18:39   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:39 UTC (permalink / raw)
  To: joe; +Cc: trivial, fubar, bonding-devel, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:25 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] drivers/net/pcmcia: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 03/10] drivers/net/pcmcia: " Joe Perches
@ 2010-11-17 18:39   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:39 UTC (permalink / raw)
  To: joe; +Cc: trivial, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:26 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 04/10] drivers/net/qla3xxx.c: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 04/10] drivers/net/qla3xxx.c: " Joe Perches
@ 2010-11-17 18:39   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:39 UTC (permalink / raw)
  To: joe; +Cc: trivial, ron.mercer, linux-driver, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:27 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 05/10] drivers/net/qlge: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 05/10] drivers/net/qlge: " Joe Perches
@ 2010-11-17 18:39   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:39 UTC (permalink / raw)
  To: joe; +Cc: trivial, ron.mercer, linux-driver, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:28 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 06/10] drivers/net/usb: " Joe Perches
  2010-11-16 17:59   ` Petko Manolov
@ 2010-11-17 18:40   ` David Miller
  1 sibling, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:40 UTC (permalink / raw)
  To: joe; +Cc: trivial, petkan, gregkh, linux-usb, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:29 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 07/10] drivers/net/vxge: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 07/10] drivers/net/vxge: " Joe Perches
  2010-11-15 22:51   ` Jon Mason
@ 2010-11-17 18:44   ` David Miller
  1 sibling, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:44 UTC (permalink / raw)
  To: joe
  Cc: trivial, ramkrishna.vepa, sivakumar.subramani, sreenivasa.honnur,
	jon.mason, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:30 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

VXGE folks, note that this means any patches you send to me need
to take Joe's changes into account.  If you diff against current
net-next-2.6 you'll be fine.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/10] drivers/net: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 08/10] drivers/net: " Joe Perches
@ 2010-11-17 18:45   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:45 UTC (permalink / raw)
  To: joe; +Cc: trivial, p_gortmaker, ysato, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:31 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 10/10] net/atm: Remove unnecessary casts of netdev_priv
  2010-11-15 21:12 ` [PATCH 10/10] net/atm: " Joe Perches
@ 2010-11-17 18:45   ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-17 18:45 UTC (permalink / raw)
  To: joe; +Cc: trivial, netdev, linux-kernel

From: Joe Perches <joe@perches.com>
Date: Mon, 15 Nov 2010 13:12:33 -0800

> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-16 17:59   ` Petko Manolov
@ 2010-11-17 18:45     ` David Miller
  2010-11-18  7:24       ` Petko Manolov
  0 siblings, 1 reply; 28+ messages in thread
From: David Miller @ 2010-11-17 18:45 UTC (permalink / raw)
  To: petkan; +Cc: joe, trivial, petkan, gregkh, linux-usb, netdev, linux-kernel

From: Petko Manolov <petkan@nucleusys.com>
Date: Tue, 16 Nov 2010 19:59:29 +0200 (EET)

> ACK! :-)

Please do not top post.

Also, please use a properly formed "Acked-by: " tag if you want
your ACK to actually show up in the commit log message.

Thanks.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-17 18:45     ` David Miller
@ 2010-11-18  7:24       ` Petko Manolov
  2010-11-18 16:14         ` David Miller
  0 siblings, 1 reply; 28+ messages in thread
From: Petko Manolov @ 2010-11-18  7:24 UTC (permalink / raw)
  To: David Miller
  Cc: joe, trivial, petkan, gregkh, linux-usb, netdev, linux-kernel

On Wed, 17 Nov 2010, David Miller wrote:

> From: Petko Manolov <petkan@nucleusys.com>
> Date: Tue, 16 Nov 2010 19:59:29 +0200 (EET)
>
>> ACK! :-)
>
> Please do not top post.

Sorry about that.

> Also, please use a properly formed "Acked-by: " tag if you want
> your ACK to actually show up in the commit log message.

My "ack" was only a notification that i've checked the patch.  It was not 
meant to go into the logs.


cheers,
Petko

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] drivers/net/usb: Remove unnecessary casts of netdev_priv
  2010-11-18  7:24       ` Petko Manolov
@ 2010-11-18 16:14         ` David Miller
  0 siblings, 0 replies; 28+ messages in thread
From: David Miller @ 2010-11-18 16:14 UTC (permalink / raw)
  To: petkan; +Cc: joe, trivial, petkan, gregkh, linux-usb, netdev, linux-kernel

From: Petko Manolov <petkan@nucleusys.com>
Date: Thu, 18 Nov 2010 09:24:49 +0200 (EET)

> On Wed, 17 Nov 2010, David Miller wrote:
> 
>> Also, please use a properly formed "Acked-by: " tag if you want
>> your ACK to actually show up in the commit log message.
> 
> My "ack" was only a notification that i've checked the patch.  It was
> not meant to go into the logs.

The fact that a developer has checked the patch is important and
useful information, so I find it strange that you would want to elide
that record from the commit message. :-)

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2010-11-18 16:14 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 21:12 [PATCH 00/10] Remove unnecessary casts of netdev_priv Joe Perches
2010-11-15 21:12 ` [PATCH 01/10] drivers/isdn/i4l: " Joe Perches
2010-11-17 18:39   ` David Miller
2010-11-15 21:12 ` [PATCH 02/10] drivers/net/bonding: " Joe Perches
2010-11-17 18:39   ` David Miller
2010-11-15 21:12 ` [PATCH 03/10] drivers/net/pcmcia: " Joe Perches
2010-11-17 18:39   ` David Miller
2010-11-15 21:12 ` [PATCH 04/10] drivers/net/qla3xxx.c: " Joe Perches
2010-11-17 18:39   ` David Miller
2010-11-15 21:12 ` [PATCH 05/10] drivers/net/qlge: " Joe Perches
2010-11-17 18:39   ` David Miller
2010-11-15 21:12 ` [PATCH 06/10] drivers/net/usb: " Joe Perches
2010-11-16 17:59   ` Petko Manolov
2010-11-17 18:45     ` David Miller
2010-11-18  7:24       ` Petko Manolov
2010-11-18 16:14         ` David Miller
2010-11-17 18:40   ` David Miller
2010-11-15 21:12 ` [PATCH 07/10] drivers/net/vxge: " Joe Perches
2010-11-15 22:51   ` Jon Mason
2010-11-17 18:44   ` David Miller
2010-11-15 21:12 ` [PATCH 08/10] drivers/net: " Joe Perches
2010-11-17 18:45   ` David Miller
2010-11-15 21:12 ` [PATCH 09/10] drivers/staging: " Joe Perches
2010-11-16  7:20   ` Belisko Marek
2010-11-16  7:30     ` Joe Perches
2010-11-16  7:37       ` Belisko Marek
2010-11-15 21:12 ` [PATCH 10/10] net/atm: " Joe Perches
2010-11-17 18:45   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).