Commit c1a04339 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk Committed by David Vrabel

xen/pciback: Remove tons of dereferences

A little cleanup. No functional difference.
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 15390613
...@@ -631,10 +631,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, ...@@ -631,10 +631,12 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
{ {
pci_ers_result_t res = result; pci_ers_result_t res = result;
struct xen_pcie_aer_op *aer_op; struct xen_pcie_aer_op *aer_op;
struct xen_pcibk_device *pdev = psdev->pdev;
struct xen_pci_sharedinfo *sh_info = pdev->sh_info;
int ret; int ret;
/*with PV AER drivers*/ /*with PV AER drivers*/
aer_op = &(psdev->pdev->sh_info->aer_op); aer_op = &(sh_info->aer_op);
aer_op->cmd = aer_cmd ; aer_op->cmd = aer_cmd ;
/*useful for error_detected callback*/ /*useful for error_detected callback*/
aer_op->err = state; aer_op->err = state;
...@@ -655,36 +657,36 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev, ...@@ -655,36 +657,36 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
* this flag to judge whether we need to check pci-front give aer * this flag to judge whether we need to check pci-front give aer
* service ack signal * service ack signal
*/ */
set_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); set_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags);
/*It is possible that a pcifront conf_read_write ops request invokes /*It is possible that a pcifront conf_read_write ops request invokes
* the callback which cause the spurious execution of wake_up. * the callback which cause the spurious execution of wake_up.
* Yet it is harmless and better than a spinlock here * Yet it is harmless and better than a spinlock here
*/ */
set_bit(_XEN_PCIB_active, set_bit(_XEN_PCIB_active,
(unsigned long *)&psdev->pdev->sh_info->flags); (unsigned long *)&sh_info->flags);
wmb(); wmb();
notify_remote_via_irq(psdev->pdev->evtchn_irq); notify_remote_via_irq(pdev->evtchn_irq);
ret = wait_event_timeout(xen_pcibk_aer_wait_queue, ret = wait_event_timeout(xen_pcibk_aer_wait_queue,
!(test_bit(_XEN_PCIB_active, (unsigned long *) !(test_bit(_XEN_PCIB_active, (unsigned long *)
&psdev->pdev->sh_info->flags)), 300*HZ); &sh_info->flags)), 300*HZ);
if (!ret) { if (!ret) {
if (test_bit(_XEN_PCIB_active, if (test_bit(_XEN_PCIB_active,
(unsigned long *)&psdev->pdev->sh_info->flags)) { (unsigned long *)&sh_info->flags)) {
dev_err(&psdev->dev->dev, dev_err(&psdev->dev->dev,
"pcifront aer process not responding!\n"); "pcifront aer process not responding!\n");
clear_bit(_XEN_PCIB_active, clear_bit(_XEN_PCIB_active,
(unsigned long *)&psdev->pdev->sh_info->flags); (unsigned long *)&sh_info->flags);
aer_op->err = PCI_ERS_RESULT_NONE; aer_op->err = PCI_ERS_RESULT_NONE;
return res; return res;
} }
} }
clear_bit(_PCIB_op_pending, (unsigned long *)&psdev->pdev->flags); clear_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags);
if (test_bit(_XEN_PCIF_active, if (test_bit(_XEN_PCIF_active,
(unsigned long *)&psdev->pdev->sh_info->flags)) { (unsigned long *)&sh_info->flags)) {
dev_dbg(&psdev->dev->dev, dev_dbg(&psdev->dev->dev,
"schedule pci_conf service in " DRV_NAME "\n"); "schedule pci_conf service in " DRV_NAME "\n");
xen_pcibk_test_and_schedule_op(psdev->pdev); xen_pcibk_test_and_schedule_op(psdev->pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment