Skip to contentSkip to conversation

use setup_timer() helper function.

PATCH New Allen Pais 1 participant 6 messages Sep 22, 2017

Subsystems (2)
lore
Share & tools
lore

Allen Pais

author
#0 lore raw

cover use setup_timer() helper function.

This series uses setup_timer() helper function. The series addresses the files under drivers/target/iscsi/*.

Allen Pais (5):
iscsi-target: use setup_timer() helper.
iscsi-target: use setup_timer() helper.
iscsi-target: use setup_timer() helper.
iscsi-target: use setup_timer() helper.
iscsi-target: use setup_timer() helper.

 drivers/target/iscsi/iscsi_target_erl0.c  | 5 ++---
 drivers/target/iscsi/iscsi_target_erl1.c  | 5 ++---
 drivers/target/iscsi/iscsi_target_login.c | 5 ++---
 drivers/target/iscsi/iscsi_target_nego.c  | 5 ++---
 drivers/target/iscsi/iscsi_target_util.c  | 5 ++---
 5 files changed, 10 insertions(+), 15 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/5 iscsi-target: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/target/iscsi/iscsi_target_nego.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/target/iscsi/iscsi_target_nego.c +2 -3
index 7a6751f..5b22f01 100644
@@ -618,10 +618,9 @@ static void iscsi_target_do_login_rx(struct work_struct *work)
 	conn->login_kworker = current;
 	allow_signal(SIGINT);
 
-	init_timer(&login_timer);
+	setup_timer(&login_timer, iscsi_target_login_timeout,
+		    (unsigned long)conn);
 	login_timer.expires = (get_jiffies_64() + TA_LOGIN_TIMEOUT * HZ);
-	login_timer.data = (unsigned long)conn;
-	login_timer.function = iscsi_target_login_timeout;
 	add_timer(&login_timer);
 	pr_debug("Starting login_timer for %s/%d\n", current->comm, current->pid);
 
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/5 iscsi-target: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/target/iscsi/iscsi_target_login.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/target/iscsi/iscsi_target_login.c +2 -3
index dc13afb..e608fd5 100644
@@ -866,10 +866,9 @@ static void iscsi_start_login_thread_timer(struct iscsi_np *np)
 	 * point we do not have access to ISCSI_TPG_ATTRIB(tpg)->login_timeout
 	 */
 	spin_lock_bh(&np->np_thread_lock);
-	init_timer(&np->np_login_timer);
+	setup_timer(&np->np_login_timer, iscsi_handle_login_thread_timeout,
+		    (unsigned long)np);
 	np->np_login_timer.expires = (get_jiffies_64() + TA_LOGIN_TIMEOUT * HZ);
-	np->np_login_timer.data = (unsigned long)np;
-	np->np_login_timer.function = iscsi_handle_login_thread_timeout;
 	np->np_login_timer_flags &= ~ISCSI_TF_STOP;
 	np->np_login_timer_flags |= ISCSI_TF_RUNNING;
 	add_timer(&np->np_login_timer);
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/5 iscsi-target: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/target/iscsi/iscsi_target_erl0.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/target/iscsi/iscsi_target_erl0.c +2 -3
index 7fe2aa7..3131d7b 100644
@@ -809,11 +809,10 @@ void iscsit_start_time2retain_handler(struct iscsi_session *sess)
 	pr_debug("Starting Time2Retain timer for %u seconds on"
 		" SID: %u\n", sess->sess_ops->DefaultTime2Retain, sess->sid);
 
-	init_timer(&sess->time2retain_timer);
+	setup_timer(&sess->time2retain_timer,
+		    iscsit_handle_time2retain_timeout, (unsigned long)sess);
 	sess->time2retain_timer.expires =
 		(get_jiffies_64() + sess->sess_ops->DefaultTime2Retain * HZ);
-	sess->time2retain_timer.data = (unsigned long)sess;
-	sess->time2retain_timer.function = iscsit_handle_time2retain_timeout;
 	sess->time2retain_timer_flags &= ~ISCSI_TF_STOP;
 	sess->time2retain_timer_flags |= ISCSI_TF_RUNNING;
 	add_timer(&sess->time2retain_timer);
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/5 iscsi-target: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/target/iscsi/iscsi_target_erl1.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/target/iscsi/iscsi_target_erl1.c +2 -3
index fe9b7f1..858d9c6 100644
@@ -1264,10 +1264,9 @@ void iscsit_start_dataout_timer(
 	pr_debug("Starting DataOUT timer for ITT: 0x%08x on"
 		" CID: %hu.\n", cmd->init_task_tag, conn->cid);
 
-	init_timer(&cmd->dataout_timer);
+	setup_timer(&cmd->dataout_timer, iscsit_handle_dataout_timeout,
+		    (unsigned long)cmd);
 	cmd->dataout_timer.expires = (get_jiffies_64() + na->dataout_timeout * HZ);
-	cmd->dataout_timer.data = (unsigned long)cmd;
-	cmd->dataout_timer.function = iscsit_handle_dataout_timeout;
 	cmd->dataout_timer_flags &= ~ISCSI_TF_STOP;
 	cmd->dataout_timer_flags |= ISCSI_TF_RUNNING;
 	add_timer(&cmd->dataout_timer);
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/5 iscsi-target: use setup_timer() helper.

In reply to Allen Pais

Use setup_timer function instead of initializing timer with the function and data fields.

---
 drivers/target/iscsi/iscsi_target_util.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/target/iscsi/iscsi_target_util.c +2 -3
index 1e36f83..97697a9 100644
@@ -949,11 +949,10 @@ void iscsit_start_nopin_response_timer(struct iscsi_conn *conn)
 		return;
 	}
 
-	init_timer(&conn->nopin_response_timer);
+	setup_timer(&conn->nopin_response_timer,
+		    iscsit_handle_nopin_response_timeout, (unsigned long)conn);
 	conn->nopin_response_timer.expires =
 		(get_jiffies_64() + na->nopin_response_timeout * HZ);
-	conn->nopin_response_timer.data = (unsigned long)conn;
-	conn->nopin_response_timer.function = iscsit_handle_nopin_response_timeout;
 	conn->nopin_response_timer_flags &= ~ISCSI_TF_STOP;
 	conn->nopin_response_timer_flags |= ISCSI_TF_RUNNING;
 	add_timer(&conn->nopin_response_timer);
Signature · 1 line
2.7.4