diff options
author | Roland Dreier <roland@purestorage.com> | 2012-10-31 09:16:47 -0700 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-06 20:55:45 -0800 |
commit | 1f981de55a46777ca0da93af5faf7d3f6e7e7000 (patch) | |
tree | e2e83a261f66d4887b8684134c9cfc1ca57e2a58 /drivers/target/iscsi/iscsi_target_tq.c | |
parent | 48c2567d1a10b5a2cab72b37775b886b08f88726 (diff) |
iscsi-target: Use list_first_entry() where appropriate
Instead of using the obfuscated pattern of
list_for_each_entry(var, list, ...)
break;
to set var to the first entry of a list, use the straightforward
var = list_first_entry(list, ...);
Reported-by: Joern Engel <joern@logfs.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_tq.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tq.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tq.c b/drivers/target/iscsi/iscsi_target_tq.c index 9d881a000e4..81289520f96 100644 --- a/drivers/target/iscsi/iscsi_target_tq.c +++ b/drivers/target/iscsi/iscsi_target_tq.c @@ -66,8 +66,7 @@ static struct iscsi_thread_set *iscsi_get_ts_from_inactive_list(void) return NULL; } - list_for_each_entry(ts, &inactive_ts_list, ts_list) - break; + ts = list_first_entry(&inactive_ts_list, struct iscsi_thread_set, ts_list); list_del(&ts->ts_list); iscsit_global->inactive_ts--; |