diff options
author | Paul Durrant <Paul.Durrant@citrix.com> | 2017-03-02 07:54:25 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-03 12:36:15 -0500 |
commit | d67ce7da3b1eda838db7bdca86d7ec28ef37068e (patch) | |
tree | cb2d90c092ed661ac3574541e82219db9863e5c0 | |
parent | f7bb3d86a64775e0a7636d211dbd80cbeea6e618 (diff) |
xen-netback: keep a local pointer for vif in backend_disconnect()
This patch replaces use of 'be->vif' with 'vif' and hence generally
makes the function look tidier. No semantic change.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/xen-netback/xenbus.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index bb854f92f5a5..d82ddc913b4c 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -492,24 +492,28 @@ static int backend_create_xenvif(struct backend_info *be) | |||
492 | 492 | ||
493 | static void backend_disconnect(struct backend_info *be) | 493 | static void backend_disconnect(struct backend_info *be) |
494 | { | 494 | { |
495 | if (be->vif) { | 495 | struct xenvif *vif = be->vif; |
496 | |||
497 | if (vif) { | ||
496 | unsigned int queue_index; | 498 | unsigned int queue_index; |
497 | 499 | ||
498 | xen_unregister_watchers(be->vif); | 500 | xen_unregister_watchers(vif); |
499 | #ifdef CONFIG_DEBUG_FS | 501 | #ifdef CONFIG_DEBUG_FS |
500 | xenvif_debugfs_delif(be->vif); | 502 | xenvif_debugfs_delif(vif); |
501 | #endif /* CONFIG_DEBUG_FS */ | 503 | #endif /* CONFIG_DEBUG_FS */ |
502 | xenvif_disconnect_data(be->vif); | 504 | xenvif_disconnect_data(vif); |
503 | for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index) | 505 | for (queue_index = 0; |
504 | xenvif_deinit_queue(&be->vif->queues[queue_index]); | 506 | queue_index < vif->num_queues; |
505 | 507 | ++queue_index) | |
506 | spin_lock(&be->vif->lock); | 508 | xenvif_deinit_queue(&vif->queues[queue_index]); |
507 | vfree(be->vif->queues); | 509 | |
508 | be->vif->num_queues = 0; | 510 | spin_lock(&vif->lock); |
509 | be->vif->queues = NULL; | 511 | vfree(vif->queues); |
510 | spin_unlock(&be->vif->lock); | 512 | vif->num_queues = 0; |
511 | 513 | vif->queues = NULL; | |
512 | xenvif_disconnect_ctrl(be->vif); | 514 | spin_unlock(&vif->lock); |
515 | |||
516 | xenvif_disconnect_ctrl(vif); | ||
513 | } | 517 | } |
514 | } | 518 | } |
515 | 519 | ||