2010-11-15 20:14:10

by Joe Perches

[permalink] [raw]
Subject: [PATCH 00/11] Remove unnecessary casts of pci_get_drvdata

Joe Perches (11):
drivers/i2c/busses/i2c-nforce2.c: Remove unnecessary casts of pci_get_drvdata
drivers/ide/pmac.c: Remove unnecessary casts of pci_get_drvdata
drivers/media/dvb/ngene/ngene-core.c: Remove unnecessary casts of pci_get_drvdata
drivers/misc/ibmasm/module.c: Remove unnecessary casts of pci_get_drvdata
drivers/net/irda: Remove unnecessary casts of pci_get_drvdata
drivers/net/s2io.c: Remove unnecessary casts of pci_get_drvdata
drivers/net/vxge/vxge-main.c: Remove unnecessary casts of pci_get_drvdata
drivers/scsi/be2iscsi/be_main.c: Remove unnecessary casts of pci_get_drvdata
drivers/staging: Remove unnecessary casts of pci_get_drvdata
drivers/usb/host/uhci-hcd.c: Remove unnecessary casts of pci_get_drvdata
sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata

drivers/i2c/busses/i2c-nforce2.c | 2 +-
drivers/ide/pmac.c | 4 ++--
drivers/media/dvb/ngene/ngene-core.c | 2 +-
drivers/misc/ibmasm/module.c | 2 +-
drivers/net/irda/donauboe.c | 6 +++---
drivers/net/irda/vlsi_ir.c | 2 +-
drivers/net/s2io.c | 3 +--
drivers/net/vxge/vxge-main.c | 28 ++++++++++++----------------
drivers/scsi/be2iscsi/be_main.c | 2 +-
drivers/staging/crystalhd/crystalhd_lnx.c | 6 +++---
drivers/staging/et131x/et131x_initpci.c | 2 +-
drivers/staging/wlags49_h2/wl_pci.c | 2 +-
drivers/usb/host/uhci-hcd.c | 2 +-
sound/pci/asihpi/hpioctl.c | 2 +-
14 files changed, 30 insertions(+), 35 deletions(-)

--
1.7.3.1.g432b3.dirty


2010-11-15 20:14:14

by Joe Perches

[permalink] [raw]
Subject: [PATCH 06/11] drivers/net/s2io.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/s2io.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index ecc25aa..0f4219c 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -8321,8 +8321,7 @@ mem_alloc_failed:

static void __devexit s2io_rem_nic(struct pci_dev *pdev)
{
- struct net_device *dev =
- (struct net_device *)pci_get_drvdata(pdev);
+ struct net_device *dev = pci_get_drvdata(pdev);
struct s2io_nic *sp;

if (dev == NULL) {
--
1.7.3.1.g432b3.dirty

2010-11-15 20:14:19

by Joe Perches

[permalink] [raw]
Subject: [PATCH 11/11] sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
sound/pci/asihpi/hpioctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index 62895a7..22dbd91 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -435,7 +435,7 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev)
struct hpi_message hm;
struct hpi_response hr;
struct hpi_adapter *pa;
- pa = (struct hpi_adapter *)pci_get_drvdata(pci_dev);
+ pa = pci_get_drvdata(pci_dev);

hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM,
HPI_SUBSYS_DELETE_ADAPTER);
--
1.7.3.1.g432b3.dirty

2010-11-15 20:14:34

by Joe Perches

[permalink] [raw]
Subject: [PATCH 10/11] drivers/usb/host/uhci-hcd.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/usb/host/uhci-hcd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
index f52d04d..cee8678 100644
--- a/drivers/usb/host/uhci-hcd.c
+++ b/drivers/usb/host/uhci-hcd.c
@@ -569,7 +569,7 @@ static int uhci_init(struct usb_hcd *hcd)
*/
static void uhci_shutdown(struct pci_dev *pdev)
{
- struct usb_hcd *hcd = (struct usb_hcd *) pci_get_drvdata(pdev);
+ struct usb_hcd *hcd = pci_get_drvdata(pdev);

uhci_hc_died(hcd_to_uhci(hcd));
}
--
1.7.3.1.g432b3.dirty

2010-11-15 20:14:45

by Joe Perches

[permalink] [raw]
Subject: [PATCH 09/11] drivers/staging: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/staging/crystalhd/crystalhd_lnx.c | 6 +++---
drivers/staging/et131x/et131x_initpci.c | 2 +-
drivers/staging/wlags49_h2/wl_pci.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 28c6b8c..719e70b 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -516,7 +516,7 @@ static void __devexit chd_dec_pci_remove(struct pci_dev *pdev)

BCMLOG_ENTER;

- pinfo = (struct crystalhd_adp *) pci_get_drvdata(pdev);
+ pinfo = pci_get_drvdata(pdev);
if (!pinfo) {
BCMLOG_ERR("could not get adp\n");
return;
@@ -626,7 +626,7 @@ int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
struct crystalhd_ioctl_data *temp;
enum BC_STATUS sts = BC_STS_SUCCESS;

- adp = (struct crystalhd_adp *)pci_get_drvdata(pdev);
+ adp = pci_get_drvdata(pdev);
if (!adp) {
BCMLOG_ERR("could not get adp\n");
return -ENODEV;
@@ -660,7 +660,7 @@ int chd_dec_pci_resume(struct pci_dev *pdev)
enum BC_STATUS sts = BC_STS_SUCCESS;
int rc;

- adp = (struct crystalhd_adp *)pci_get_drvdata(pdev);
+ adp = pci_get_drvdata(pdev);
if (!adp) {
BCMLOG_ERR("could not get adp\n");
return -ENODEV;
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 10bcb45..f62ba7a 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -783,7 +783,7 @@ static void __devexit et131x_pci_remove(struct pci_dev *pdev)
/* Retrieve the net_device pointer from the pci_dev struct, as well
* as the private adapter struct
*/
- netdev = (struct net_device *) pci_get_drvdata(pdev);
+ netdev = pci_get_drvdata(pdev);
adapter = netdev_priv(netdev);

/* Perform device cleanup */
diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c
index 020b17a..28ae9dd 100644
--- a/drivers/staging/wlags49_h2/wl_pci.c
+++ b/drivers/staging/wlags49_h2/wl_pci.c
@@ -458,7 +458,7 @@ void __devexit wl_pci_remove(struct pci_dev *pdev)
return;
}

- dev = (struct net_device *)pci_get_drvdata( pdev );
+ dev = pci_get_drvdata( pdev );
if( dev == NULL ) {
DBG_ERROR( DbgInfo, "Could not retrieve net_device structure\n" );
return;
--
1.7.3.1.g432b3.dirty

2010-11-15 20:14:12

by Joe Perches

[permalink] [raw]
Subject: [PATCH 02/11] drivers/ide/pmac.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/ide/pmac.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c
index ebcf8e4..1db7c43 100644
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1334,7 +1334,7 @@ out_free_pmif:
static int
pmac_ide_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
{
- pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)pci_get_drvdata(pdev);
+ pmac_ide_hwif_t *pmif = pci_get_drvdata(pdev);
int rc = 0;

if (mesg.event != pdev->dev.power.power_state.event
@@ -1350,7 +1350,7 @@ pmac_ide_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
static int
pmac_ide_pci_resume(struct pci_dev *pdev)
{
- pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)pci_get_drvdata(pdev);
+ pmac_ide_hwif_t *pmif = pci_get_drvdata(pdev);
int rc = 0;

if (pdev->dev.power.power_state.event != PM_EVENT_ON) {
--
1.7.3.1.g432b3.dirty

2010-11-15 20:14:11

by Joe Perches

[permalink] [raw]
Subject: [PATCH 01/11] drivers/i2c/busses/i2c-nforce2.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/i2c/busses/i2c-nforce2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index a605a50..ff1e127 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -432,7 +432,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_

static void __devexit nforce2_remove(struct pci_dev *dev)
{
- struct nforce2_smbus *smbuses = (void*) pci_get_drvdata(dev);
+ struct nforce2_smbus *smbuses = pci_get_drvdata(dev);

nforce2_set_reference(NULL);
if (smbuses[0].base) {
--
1.7.3.1.g432b3.dirty

2010-11-15 20:15:30

by Joe Perches

[permalink] [raw]
Subject: [PATCH 08/11] drivers/scsi/be2iscsi/be_main.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/scsi/be2iscsi/be_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 75a85aa..b00b904 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -4103,7 +4103,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
u8 *real_offset = 0;
u32 value = 0;

- phba = (struct beiscsi_hba *)pci_get_drvdata(pcidev);
+ phba = pci_get_drvdata(pcidev);
if (!phba) {
dev_err(&pcidev->dev, "beiscsi_remove called with no phba\n");
return;
--
1.7.3.1.g432b3.dirty

2010-11-15 20:15:52

by Joe Perches

[permalink] [raw]
Subject: [PATCH 07/11] drivers/net/vxge/vxge-main.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/vxge/vxge-main.c | 28 ++++++++++++----------------
1 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 3f2d6ed..22c7d79 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -688,7 +688,7 @@ static int vxge_learn_mac(struct vxgedev *vdev, u8 *mac_header)
struct vxge_vpath *vpath = NULL;
struct __vxge_hw_device *hldev;

- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

mac_address = (u8 *)&mac_addr;
memcpy(mac_address, mac_header, ETH_ALEN);
@@ -1313,7 +1313,7 @@ static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
struct __vxge_hw_device *hldev;
int msix_id;

- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

vxge_hw_vpath_wait_receive_idle(hldev, vpath->device_id);

@@ -1632,8 +1632,7 @@ static int vxge_poll_inta(struct napi_struct *napi, int budget)
int budget_org = budget;
struct vxge_ring *ring;

- struct __vxge_hw_device *hldev = (struct __vxge_hw_device *)
- pci_get_drvdata(vdev->pdev);
+ struct __vxge_hw_device *hldev = pci_get_drvdata(vdev->pdev);

for (i = 0; i < vdev->no_of_vpath; i++) {
ring = &vdev->vpaths[i].ring;
@@ -1673,7 +1672,7 @@ static void vxge_netpoll(struct net_device *dev)
struct vxgedev *vdev;

vdev = (struct vxgedev *)netdev_priv(dev);
- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);

@@ -2107,7 +2106,7 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id)
vxge_debug_intr(VXGE_TRACE, "%s:%d", __func__, __LINE__);

dev = vdev->ndev;
- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

if (pci_channel_offline(vdev->pdev))
return IRQ_NONE;
@@ -2342,7 +2341,7 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev)
static void vxge_rem_isr(struct vxgedev *vdev)
{
struct __vxge_hw_device *hldev;
- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

#ifdef CONFIG_PCI_MSI
if (vdev->config.intr_type == MSI_X) {
@@ -2583,7 +2582,7 @@ vxge_open(struct net_device *dev)
"%s: %s:%d", dev->name, __func__, __LINE__);

vdev = (struct vxgedev *)netdev_priv(dev);
- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);
function_mode = vdev->config.device_hw_info.function_mode;

/* make sure you have link off by default every time Nic is
@@ -2811,7 +2810,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
dev->name, __func__, __LINE__);

vdev = (struct vxgedev *)netdev_priv(dev);
- hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
+ hldev = pci_get_drvdata(vdev->pdev);

if (unlikely(!is_vxge_card_up(vdev)))
return 0;
@@ -3985,8 +3984,7 @@ static int vxge_pm_resume(struct pci_dev *pdev)
static pci_ers_result_t vxge_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{
- struct __vxge_hw_device *hldev =
- (struct __vxge_hw_device *)pci_get_drvdata(pdev);
+ struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
struct net_device *netdev = hldev->ndev;

netif_device_detach(netdev);
@@ -4015,8 +4013,7 @@ static pci_ers_result_t vxge_io_error_detected(struct pci_dev *pdev,
*/
static pci_ers_result_t vxge_io_slot_reset(struct pci_dev *pdev)
{
- struct __vxge_hw_device *hldev =
- (struct __vxge_hw_device *)pci_get_drvdata(pdev);
+ struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
struct net_device *netdev = hldev->ndev;

struct vxgedev *vdev = netdev_priv(netdev);
@@ -4041,8 +4038,7 @@ static pci_ers_result_t vxge_io_slot_reset(struct pci_dev *pdev)
*/
static void vxge_io_resume(struct pci_dev *pdev)
{
- struct __vxge_hw_device *hldev =
- (struct __vxge_hw_device *)pci_get_drvdata(pdev);
+ struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
struct net_device *netdev = hldev->ndev;

if (netif_running(netdev)) {
@@ -4689,7 +4685,7 @@ static void __devexit vxge_remove(struct pci_dev *pdev)
struct net_device *dev;
int i = 0;

- hldev = (struct __vxge_hw_device *)pci_get_drvdata(pdev);
+ hldev = pci_get_drvdata(pdev);

if (hldev == NULL)
return;
--
1.7.3.1.g432b3.dirty

2010-11-15 20:16:14

by Joe Perches

[permalink] [raw]
Subject: [PATCH 05/11] drivers/net/irda: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/irda/donauboe.c | 6 +++---
drivers/net/irda/vlsi_ir.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index b626ccc..bee5ccc 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1488,7 +1488,7 @@ static void
toshoboe_close (struct pci_dev *pci_dev)
{
int i;
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
+ struct toshoboe_cb *self = pci_get_drvdata(pci_dev);

IRDA_DEBUG (4, "%s()\n", __func__);

@@ -1698,7 +1698,7 @@ freeself:
static int
toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
{
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
+ struct toshoboe_cb *self = pci_get_drvdata(pci_dev);
unsigned long flags;
int i = 10;

@@ -1727,7 +1727,7 @@ toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
static int
toshoboe_wakeup (struct pci_dev *pci_dev)
{
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
+ struct toshoboe_cb *self = pci_get_drvdata(pci_dev);
unsigned long flags;

IRDA_DEBUG (4, "%s()\n", __func__);
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index c3d0738..62f2d12 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -542,7 +542,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
int crclen, len = 0;
struct sk_buff *skb;
int ret = 0;
- struct net_device *ndev = (struct net_device *)pci_get_drvdata(r->pdev);
+ struct net_device *ndev = pci_get_drvdata(r->pdev);
vlsi_irda_dev_t *idev = netdev_priv(ndev);

pci_dma_sync_single_for_cpu(r->pdev, rd_get_addr(rd), r->len, r->dir);
--
1.7.3.1.g432b3.dirty

2010-11-15 20:16:35

by Joe Perches

[permalink] [raw]
Subject: [PATCH 04/11] drivers/misc/ibmasm/module.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/misc/ibmasm/module.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/ibmasm/module.c b/drivers/misc/ibmasm/module.c
index a234d96..9e5e407 100644
--- a/drivers/misc/ibmasm/module.c
+++ b/drivers/misc/ibmasm/module.c
@@ -165,7 +165,7 @@ error_resources:

static void __devexit ibmasm_remove_one(struct pci_dev *pdev)
{
- struct service_processor *sp = (struct service_processor *)pci_get_drvdata(pdev);
+ struct service_processor *sp = pci_get_drvdata(pdev);

dbg("Unregistering UART\n");
ibmasm_unregister_uart(sp);
--
1.7.3.1.g432b3.dirty

2010-11-15 20:16:47

by Joe Perches

[permalink] [raw]
Subject: [PATCH 03/11] drivers/media/dvb/ngene/ngene-core.c: Remove unnecessary casts of pci_get_drvdata

Signed-off-by: Joe Perches <[email protected]>
---
drivers/media/dvb/ngene/ngene-core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index 4caeb16..1999e35 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -1516,7 +1516,7 @@ static int init_channels(struct ngene *dev)

void __devexit ngene_remove(struct pci_dev *pdev)
{
- struct ngene *dev = (struct ngene *)pci_get_drvdata(pdev);
+ struct ngene *dev = pci_get_drvdata(pdev);
int i;

tasklet_kill(&dev->event_tasklet);
--
1.7.3.1.g432b3.dirty

2010-11-15 20:54:58

by Alan Stern

[permalink] [raw]
Subject: Re: [PATCH 10/11] drivers/usb/host/uhci-hcd.c: Remove unnecessary casts of pci_get_drvdata

On Mon, 15 Nov 2010, Joe Perches wrote:

> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/usb/host/uhci-hcd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
> index f52d04d..cee8678 100644
> --- a/drivers/usb/host/uhci-hcd.c
> +++ b/drivers/usb/host/uhci-hcd.c
> @@ -569,7 +569,7 @@ static int uhci_init(struct usb_hcd *hcd)
> */
> static void uhci_shutdown(struct pci_dev *pdev)
> {
> - struct usb_hcd *hcd = (struct usb_hcd *) pci_get_drvdata(pdev);
> + struct usb_hcd *hcd = pci_get_drvdata(pdev);
>
> uhci_hc_died(hcd_to_uhci(hcd));
> }

Acked-by: Alan Stern <[email protected]>

2010-11-15 21:07:23

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 01/11] drivers/i2c/busses/i2c-nforce2.c: Remove unnecessary casts of pci_get_drvdata

On Mon, 15 Nov 2010 12:13:52 -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/i2c/busses/i2c-nforce2.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
> index a605a50..ff1e127 100644
> --- a/drivers/i2c/busses/i2c-nforce2.c
> +++ b/drivers/i2c/busses/i2c-nforce2.c
> @@ -432,7 +432,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, const struct pci_device_
>
> static void __devexit nforce2_remove(struct pci_dev *dev)
> {
> - struct nforce2_smbus *smbuses = (void*) pci_get_drvdata(dev);
> + struct nforce2_smbus *smbuses = pci_get_drvdata(dev);
>
> nforce2_set_reference(NULL);
> if (smbuses[0].base) {

Applied, thanks.

--
Jean Delvare

2010-11-15 22:51:06

by Jon Mason

[permalink] [raw]
Subject: Re: [PATCH 07/11] drivers/net/vxge/vxge-main.c: Remove unnecessary casts of pci_get_drvdata

On Mon, Nov 15, 2010 at 12:13:58PM -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

Looks good to me.

Acked-by: Jon Mason <[email protected]>
> ---
> drivers/net/vxge/vxge-main.c | 28 ++++++++++++----------------
> 1 files changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index 3f2d6ed..22c7d79 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
> @@ -688,7 +688,7 @@ static int vxge_learn_mac(struct vxgedev *vdev, u8 *mac_header)
> struct vxge_vpath *vpath = NULL;
> struct __vxge_hw_device *hldev;
>
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> mac_address = (u8 *)&mac_addr;
> memcpy(mac_address, mac_header, ETH_ALEN);
> @@ -1313,7 +1313,7 @@ static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
> struct __vxge_hw_device *hldev;
> int msix_id;
>
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> vxge_hw_vpath_wait_receive_idle(hldev, vpath->device_id);
>
> @@ -1632,8 +1632,7 @@ static int vxge_poll_inta(struct napi_struct *napi, int budget)
> int budget_org = budget;
> struct vxge_ring *ring;
>
> - struct __vxge_hw_device *hldev = (struct __vxge_hw_device *)
> - pci_get_drvdata(vdev->pdev);
> + struct __vxge_hw_device *hldev = pci_get_drvdata(vdev->pdev);
>
> for (i = 0; i < vdev->no_of_vpath; i++) {
> ring = &vdev->vpaths[i].ring;
> @@ -1673,7 +1672,7 @@ static void vxge_netpoll(struct net_device *dev)
> struct vxgedev *vdev;
>
> vdev = (struct vxgedev *)netdev_priv(dev);
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> vxge_debug_entryexit(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>
> @@ -2107,7 +2106,7 @@ static irqreturn_t vxge_isr_napi(int irq, void *dev_id)
> vxge_debug_intr(VXGE_TRACE, "%s:%d", __func__, __LINE__);
>
> dev = vdev->ndev;
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> if (pci_channel_offline(vdev->pdev))
> return IRQ_NONE;
> @@ -2342,7 +2341,7 @@ static void vxge_rem_msix_isr(struct vxgedev *vdev)
> static void vxge_rem_isr(struct vxgedev *vdev)
> {
> struct __vxge_hw_device *hldev;
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> #ifdef CONFIG_PCI_MSI
> if (vdev->config.intr_type == MSI_X) {
> @@ -2583,7 +2582,7 @@ vxge_open(struct net_device *dev)
> "%s: %s:%d", dev->name, __func__, __LINE__);
>
> vdev = (struct vxgedev *)netdev_priv(dev);
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
> function_mode = vdev->config.device_hw_info.function_mode;
>
> /* make sure you have link off by default every time Nic is
> @@ -2811,7 +2810,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
> dev->name, __func__, __LINE__);
>
> vdev = (struct vxgedev *)netdev_priv(dev);
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(vdev->pdev);
> + hldev = pci_get_drvdata(vdev->pdev);
>
> if (unlikely(!is_vxge_card_up(vdev)))
> return 0;
> @@ -3985,8 +3984,7 @@ static int vxge_pm_resume(struct pci_dev *pdev)
> static pci_ers_result_t vxge_io_error_detected(struct pci_dev *pdev,
> pci_channel_state_t state)
> {
> - struct __vxge_hw_device *hldev =
> - (struct __vxge_hw_device *)pci_get_drvdata(pdev);
> + struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
> struct net_device *netdev = hldev->ndev;
>
> netif_device_detach(netdev);
> @@ -4015,8 +4013,7 @@ static pci_ers_result_t vxge_io_error_detected(struct pci_dev *pdev,
> */
> static pci_ers_result_t vxge_io_slot_reset(struct pci_dev *pdev)
> {
> - struct __vxge_hw_device *hldev =
> - (struct __vxge_hw_device *)pci_get_drvdata(pdev);
> + struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
> struct net_device *netdev = hldev->ndev;
>
> struct vxgedev *vdev = netdev_priv(netdev);
> @@ -4041,8 +4038,7 @@ static pci_ers_result_t vxge_io_slot_reset(struct pci_dev *pdev)
> */
> static void vxge_io_resume(struct pci_dev *pdev)
> {
> - struct __vxge_hw_device *hldev =
> - (struct __vxge_hw_device *)pci_get_drvdata(pdev);
> + struct __vxge_hw_device *hldev = pci_get_drvdata(pdev);
> struct net_device *netdev = hldev->ndev;
>
> if (netif_running(netdev)) {
> @@ -4689,7 +4685,7 @@ static void __devexit vxge_remove(struct pci_dev *pdev)
> struct net_device *dev;
> int i = 0;
>
> - hldev = (struct __vxge_hw_device *)pci_get_drvdata(pdev);
> + hldev = pci_get_drvdata(pdev);
>
> if (hldev == NULL)
> return;
> --
> 1.7.3.1.g432b3.dirty
>

2010-11-16 11:28:23

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH 05/11] drivers/net/irda: Remove unnecessary casts of pci_get_drvdata

Hi Joe,

On Mon, 2010-11-15 at 12:13 -0800, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
Thanks, I'll apply it to my irda tree.

Cheers,
Samuel.


> ---
> drivers/net/irda/donauboe.c | 6 +++---
> drivers/net/irda/vlsi_ir.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
> index b626ccc..bee5ccc 100644
> --- a/drivers/net/irda/donauboe.c
> +++ b/drivers/net/irda/donauboe.c
> @@ -1488,7 +1488,7 @@ static void
> toshoboe_close (struct pci_dev *pci_dev)
> {
> int i;
> - struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
> + struct toshoboe_cb *self = pci_get_drvdata(pci_dev);
>
> IRDA_DEBUG (4, "%s()\n", __func__);
>
> @@ -1698,7 +1698,7 @@ freeself:
> static int
> toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
> {
> - struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
> + struct toshoboe_cb *self = pci_get_drvdata(pci_dev);
> unsigned long flags;
> int i = 10;
>
> @@ -1727,7 +1727,7 @@ toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
> static int
> toshoboe_wakeup (struct pci_dev *pci_dev)
> {
> - struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
> + struct toshoboe_cb *self = pci_get_drvdata(pci_dev);
> unsigned long flags;
>
> IRDA_DEBUG (4, "%s()\n", __func__);
> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
> index c3d0738..62f2d12 100644
> --- a/drivers/net/irda/vlsi_ir.c
> +++ b/drivers/net/irda/vlsi_ir.c
> @@ -542,7 +542,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
> int crclen, len = 0;
> struct sk_buff *skb;
> int ret = 0;
> - struct net_device *ndev = (struct net_device *)pci_get_drvdata(r->pdev);
> + struct net_device *ndev = pci_get_drvdata(r->pdev);
> vlsi_irda_dev_t *idev = netdev_priv(ndev);
>
> pci_dma_sync_single_for_cpu(r->pdev, rd_get_addr(rd), r->len, r->dir);

2010-11-17 20:28:12

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 06/11] drivers/net/s2io.c: Remove unnecessary casts of pci_get_drvdata

From: Joe Perches <[email protected]>
Date: Mon, 15 Nov 2010 12:13:57 -0800

> Signed-off-by: Joe Perches <[email protected]>

Applied.

2010-11-17 20:28:26

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 07/11] drivers/net/vxge/vxge-main.c: Remove unnecessary casts of pci_get_drvdata

From: Jon Mason <[email protected]>
Date: Mon, 15 Nov 2010 16:50:56 -0600

> On Mon, Nov 15, 2010 at 12:13:58PM -0800, Joe Perches wrote:
>> Signed-off-by: Joe Perches <[email protected]>
>
> Looks good to me.
>
> Acked-by: Jon Mason <[email protected]>

Applied.

2010-11-22 06:44:43

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 11/11] sound/pci/asihpi/hpioctl.c: Remove unnecessary casts of pci_get_drvdata

At Mon, 15 Nov 2010 12:14:02 -0800,
Joe Perches wrote:
>
> Signed-off-by: Joe Perches <[email protected]>

Applied this one, too. Thanks.


Takashi


> ---
> sound/pci/asihpi/hpioctl.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
> index 62895a7..22dbd91 100644
> --- a/sound/pci/asihpi/hpioctl.c
> +++ b/sound/pci/asihpi/hpioctl.c
> @@ -435,7 +435,7 @@ void __devexit asihpi_adapter_remove(struct pci_dev *pci_dev)
> struct hpi_message hm;
> struct hpi_response hr;
> struct hpi_adapter *pa;
> - pa = (struct hpi_adapter *)pci_get_drvdata(pci_dev);
> + pa = pci_get_drvdata(pci_dev);
>
> hpi_init_message_response(&hm, &hr, HPI_OBJ_SUBSYSTEM,
> HPI_SUBSYS_DELETE_ADAPTER);
> --
> 1.7.3.1.g432b3.dirty
>

2010-11-22 19:37:57

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 02/11] drivers/ide/pmac.c: Remove unnecessary casts of pci_get_drvdata

From: Joe Perches <[email protected]>
Date: Mon, 15 Nov 2010 12:13:53 -0800

> Signed-off-by: Joe Perches <[email protected]>

Applied, thank you.