[PATCH 1/3] libfc: move 'pending' and 'requested' setting

Hannes Reinecke
2017-05-30T15:14:47Z

Move 'pending' and 'requested' setting out of fc_disc_gpn_fc_req()
into the calling function.

No functional change.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/libfc/fc_disc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index fd501f8..913beb5 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -242,6 +242,9 @@ static void fc_disc_restart(struct fc_disc *disc)
*/
disc->disc_id = (disc->disc_id + 2) | 1;
disc->retry_count = 0;
+ disc->pending = 1;
+ disc->requested = 0;
+
fc_disc_gpn_ft_req(disc);
}

@@ -371,9 +374,6 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)

WARN_ON(!fc_lport_test_ready(lport));

- disc->pending = 1;
- disc->requested = 0;
-
disc->buf_len = 0;
disc->seq_count = 0;
fp = fc_frame_alloc(lport,
@@ -503,6 +503,9 @@ static void fc_disc_timeout(struct work_struct *work)
struct fc_disc,
disc_work.work);
mutex_lock(&disc->disc_mutex);
+ disc->pending = 1;
+ disc->requested = 0;
+
fc_disc_gpn_ft_req(disc);