remove unnecessary pci_set_drvdata()
Subsystems (12)
cover remove unnecessary pci_set_drvdata()
Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/arcmsr/arcmsr_hba.c | 1 - drivers/scsi/atp870u.c | 2 -- drivers/scsi/bfa/bfad.c | 1 - drivers/scsi/csiostor/csio_init.c | 2 -- drivers/scsi/dc395x.c | 1 - drivers/scsi/fnic/fnic_main.c | 1 - drivers/scsi/gdth.c | 2 -- drivers/scsi/hpsa.c | 1 - drivers/scsi/lpfc/lpfc_init.c | 3 --- drivers/scsi/megaraid/megaraid_mbox.c | 6 ------ drivers/scsi/megaraid/megaraid_sas_base.c | 5 ----- drivers/scsi/mvsas/mv_init.c | 1 - drivers/scsi/mvumi.c | 2 -- drivers/scsi/pm8001/pm8001_init.c | 1 - drivers/scsi/pmcraid.c | 1 - drivers/scsi/qla2xxx/qla_os.c | 1 - drivers/scsi/qla4xxx/ql4_os.c | 1 - drivers/scsi/stex.c | 2 -- drivers/scsi/tmscsim.c | 1 - drivers/scsi/ufs/ufshcd-pci.c | 1 - drivers/scsi/vmw_pvscsi.c | 2 -- 21 files changed, 38 deletions(-)
PATCH 1/20 lpfc 8.3.42: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/lpfc/lpfc_init.c | 3 --- 1 file changed, 3 deletions(-)
drivers/scsi/lpfc/lpfc_init.c +0 -3
@@ -4581,8 +4581,6 @@ lpfc_disable_pci_dev(struct lpfc_hba *phba)/* Release PCI resource and disable PCI device */ pci_release_selected_regions (pdev, bars);pci_disable_device (pdev); -/* Null out PCI private reference to driver */ -pci_set_drvdata (pdev,NULL );return ; }
@@ -9429,7 +9427,6 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev)/* Disable interrupt */ lpfc_sli_disable_intr (phba); -pci_set_drvdata (pdev,NULL );scsi_host_put (shost);/*
Signature · 1 line
1.7.10.4
PATCH 2/20 arcmsr: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/arcmsr/arcmsr_hba.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/arcmsr/arcmsr_hba.c +0 -1
@@ -1035,7 +1035,6 @@ static void arcmsr_remove(struct pci_dev *pdev)pci_release_regions (pdev);scsi_host_put (host);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); }static void arcmsr_shutdown (struct pci_dev *pdev)
Signature · 1 line
1.7.10.4
PATCH 3/20 atp870u: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/atp870u.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/atp870u.c +0 -2
@@ -3144,8 +3144,6 @@ static void atp870u_remove (struct pci_dev *pdev)atp870u_free_tables (pshost);printk (KERN_INFO "scsi_host_put : %p\n" ,pshost);scsi_host_put (pshost); -printk (KERN_INFO "pci_set_drvdata : %p\n" ,pdev); -pci_set_drvdata (pdev,NULL ); }MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.10.4
PATCH 4/20 bfa: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/bfa/bfad.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/bfa/bfad.c +0 -1
@@ -833,7 +833,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)/* Disable PCIE Advanced Error Recovery (AER) */ pci_disable_pcie_error_reporting (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); } bfa_status_t
Signature · 1 line
1.7.10.4
PATCH 5/20 csiostor: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/csiostor/csio_init.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/csiostor/csio_init.c +0 -2
@@ -1010,7 +1010,6 @@ err_lnode_exit:csio_hw_stop (hw);spin_unlock_irq (&hw->lock);csio_lnodes_unblock_request (hw); -pci_set_drvdata (hw->pdev,NULL );csio_lnodes_exit (hw,0 );csio_hw_free (hw); err_pci_exit:
@@ -1044,7 +1043,6 @@ static void csio_remove_one(struct pci_dev *pdev)csio_lnodes_exit (hw,0 );csio_hw_free (hw); -pci_set_drvdata (pdev,NULL );csio_pci_exit (pdev, &bars); }
Signature · 1 line
1.7.10.4
PATCH 6/20 fnic: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/fnic/fnic_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/fnic/fnic_main.c +0 -1
@@ -996,7 +996,6 @@ static void fnic_remove(struct pci_dev *pdev)fnic_iounmap (fnic);pci_release_regions (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL );scsi_host_put (lp->host); }
Signature · 1 line
1.7.10.4
PATCH 7/20 gdth: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/gdth.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/gdth.c +0 -2
@@ -594,8 +594,6 @@ static void gdth_pci_remove_one(struct pci_dev *pdev) {gdth_ha_str *ha =pci_get_drvdata (pdev); -pci_set_drvdata (pdev,NULL ); -list_del (&ha->list);gdth_remove_one (ha);
Signature · 1 line
1.7.10.4
PATCH 8/20 hpsa: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/hpsa.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/hpsa.c +0 -1
@@ -5018,7 +5018,6 @@ static void hpsa_remove_one(struct pci_dev *pdev)kfree (h->hba_inquiry_data);pci_disable_device (pdev);pci_release_regions (pdev); -pci_set_drvdata (pdev,NULL );kfree (h); }
Signature · 1 line
1.7.10.4
PATCH 9/20 megaraid: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/megaraid/megaraid_mbox.c | 6 ------ drivers/scsi/megaraid/megaraid_sas_base.c | 5 ----- 2 files changed, 11 deletions(-)
drivers/scsi/megaraid/megaraid_mbox.c +0 -6
@@ -534,7 +534,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)return 0 ; out_cmm_unreg: -pci_set_drvdata (pdev,NULL );megaraid_cmm_unregister (adapter); out_fini_mbox:megaraid_fini_mbox (adapter);
@@ -594,11 +593,6 @@ megaraid_detach_one(struct pci_dev *pdev)// detach from the IO sub-system megaraid_io_detach (adapter); -// reset the device state in the PCI structure. We check this -// condition when we enter here. If the device state is NULL, -// that would mean the device has already been removed -pci_set_drvdata (pdev,NULL ); -// Unregister from common management module // // FIXME: this must return success or failure for conditions if there
drivers/scsi/megaraid/megaraid_sas_base.c +0 -5
@@ -4449,7 +4449,6 @@ retry_irq_register: megasas_mgmt_info.instance[megasas_mgmt_info.max_index] =NULL ; megasas_mgmt_info.max_index--; -pci_set_drvdata (pdev,NULL ); instance->instancet->disable_intr (instance);if (instance->msix_vectors)for (i =0 ; i < instance->msix_vectors; i++)
@@ -4805,8 +4804,6 @@ static void megasas_detach_one(struct pci_dev *pdev) } } -pci_set_drvdata (instance->pdev,NULL ); - instance->instancet->disable_intr (instance);if (instance->msix_vectors)
@@ -4848,8 +4845,6 @@ static void megasas_detach_one(struct pci_dev *pdev) instance->evt_detail, instance->evt_detail_h);scsi_host_put (host); -pci_set_drvdata (pdev,NULL ); -pci_disable_device (pdev);return ;
Signature · 1 line
1.7.10.4
PATCH 10/20 mvumi: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/mvumi.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/mvumi.c +0 -2
@@ -2583,7 +2583,6 @@ static int mvumi_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)return 0 ; fail_io_attach: -pci_set_drvdata (pdev,NULL ); mhba->instancet->disable_intr (mhba);free_irq (mhba->pdev->irq, mhba); fail_init_irq:
@@ -2618,7 +2617,6 @@ static void mvumi_detach_one(struct pci_dev *pdev)free_irq (mhba->pdev->irq, mhba);mvumi_release_fw (mhba);scsi_host_put (host); -pci_set_drvdata (pdev,NULL );pci_disable_device (pdev);dev_dbg (&pdev->dev,"driver is removed!\n" ); }
Signature · 1 line
1.7.10.4
PATCH 11/20 mvsas: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/mvsas/mv_init.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/mvsas/mv_init.c +0 -1
@@ -657,7 +657,6 @@ static void mvs_pci_remove(struct pci_dev *pdev)tasklet_kill (&((struct mvs_prv_info *)sha->lldd_ha)->mv_tasklet);#endif -pci_set_drvdata (pdev,NULL );sas_unregister_ha (sha);sas_remove_host (mvi->shost);scsi_remove_host (mvi->shost);
Signature · 1 line
1.7.10.4
PATCH 12/20 pm80xx: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/pm8001/pm8001_init.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/pm8001/pm8001_init.c +0 -1
@@ -873,7 +873,6 @@ static void pm8001_pci_remove(struct pci_dev *pdev)struct pm8001_hba_info *pm8001_ha;int i; pm8001_ha = sha->lldd_ha; -pci_set_drvdata (pdev,NULL );sas_unregister_ha (sha);sas_remove_host (pm8001_ha->shost);list_del (&pm8001_ha->list);
Signature · 1 line
1.7.10.4
PATCH 13/20 pmcraid: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/pmcraid.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/pmcraid.c +0 -1
@@ -6049,7 +6049,6 @@ out_release_regions: out_disable_device:atomic_dec (&pmcraid_adapter_count); -pci_set_drvdata (pdev,NULL );pci_disable_device (pdev);return -ENODEV ; }
Signature · 1 line
1.7.10.4
PATCH 14/20 qla2xxx: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/qla2xxx/qla_os.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/qla2xxx/qla_os.c +0 -1
@@ -3183,7 +3183,6 @@ qla2x00_remove_one(struct pci_dev *pdev)pci_disable_pcie_error_reporting (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); } static void
Signature · 1 line
1.7.10.4
PATCH 15/20 qla4xxx: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/qla4xxx/ql4_os.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/qla4xxx/ql4_os.c +0 -1
@@ -7400,7 +7400,6 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev)pci_disable_pcie_error_reporting (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); }/**
Signature · 1 line
1.7.10.4
PATCH 16/20 stex: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/stex.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/stex.c +0 -2
@@ -1790,8 +1790,6 @@ static void stex_remove(struct pci_dev *pdev)scsi_remove_host (hba->host); -pci_set_drvdata (pdev,NULL ); -stex_hba_stop (hba);stex_hba_free (hba);
Signature · 1 line
1.7.10.4
PATCH 17/20 ufs: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/ufs/ufshcd-pci.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/ufs/ufshcd-pci.c +0 -1
@@ -132,7 +132,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)pm_runtime_forbid (&pdev->dev);pm_runtime_get_noresume (&pdev->dev);ufshcd_remove (hba); -pci_set_drvdata (pdev,NULL ); }/**
Signature · 1 line
1.7.10.4
PATCH 18/20 vmw_pvscsi: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/vmw_pvscsi.c | 2 -- 1 file changed, 2 deletions(-)
drivers/scsi/vmw_pvscsi.c +0 -2
@@ -1405,7 +1405,6 @@ out_release_resources: out_free_host:scsi_host_put (host); out_disable_device: -pci_set_drvdata (pdev,NULL );pci_disable_device (pdev);return error;
@@ -1445,7 +1444,6 @@ static void pvscsi_remove(struct pci_dev *pdev)scsi_host_put (host); -pci_set_drvdata (pdev,NULL );pci_disable_device (pdev); }
Signature · 1 line
1.7.10.4
PATCH 19/20 dc395x: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/dc395x.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/dc395x.c +0 -1
@@ -4859,7 +4859,6 @@ static void dc395x_remove_one(struct pci_dev *dev)adapter_uninit (acb);pci_disable_device (dev);scsi_host_put (scsi_host); -pci_set_drvdata (dev,NULL ); }
Signature · 1 line
1.7.10.4
PATCH 20/20 tmscsim: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/scsi/tmscsim.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/tmscsim.c +0 -1
@@ -2553,7 +2553,6 @@ static void dc390_remove_one(struct pci_dev *dev)pci_disable_device (dev);scsi_host_put (scsi_host); -pci_set_drvdata (dev,NULL ); }static struct pci_device_id tmscsim_pci_tbl[] = {
Signature · 1 line
1.7.10.4
Re: [PATCH 20/20] [SCSI] tmscsim: remove unnecessary pci_set_drvdata()
Quoted 5 lines · Jingoo Han
The driver core clears the driver data to NULL after
device_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.Signed-off-by Jingoo Han <[email protected]>
Thanks
Guennadi
Quoted 20 lines
--- drivers/scsi/tmscsim.c | 1 - 1 file changed, 1 deletion(-)drivers/scsi/tmscsim.c +0
-1@@ -2553,7 +2553,6 @@ static void dc390_remove_one(struct pci_dev *dev)pci_disable_device (dev);scsi_host_put (scsi_host); -pci_set_drvdata (dev,NULL ); }static struct pci_device_id tmscsim_pci_tbl[] = {Signature · 1 line
1.7.10.4
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
James Bottomley
maintainerQuoted 5 lines · Jingoo Han
Since commit
0998d0631001288a5974afc0b2a5f568bcdecb4d(device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL afterdevice_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
Look, these are particularly pointless patches. The null setting is only on teardown; the fact that we set something to NULL that should already be null doesn't matter at all the extra cycles simply won't be noticed. Please roll them into a single patch and send them to Jiří Kosina and the trivial tree (cc'd) he'll take care of checking and applying them (assuming they meet his criteria for worth bothering with).
Thanks,
James
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · James Bottomley
Quoted 5 lines · Jingoo Han
Since commit
0998d0631001288a5974afc0b2a5f568bcdecb4d(device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL afterdevice_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
Quoted 8 lines
Look, these are particularly pointless patches. The null setting is only on teardown; the fact that we set something to NULL that should already be null doesn't matter at all the extra cycles simply won't be noticed. Please roll them into a single patch and send them to Jiří Kosina and the trivial tree (cc'd) he'll take care of checking and applying them (assuming they meet his criteria for worth bothering with).
OK, I see.
I squashed all 20 patches into a single patch, and sent the single patch to Jiri Kosina and the trivial tree, as you mentioned.
Thank you for your guidance.
Best regards,
Jingoo Han
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html