From 10ffe6d6207588eccf65bf1a52893953c047060f Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 26 Jun 2012 18:59:21 +0000 Subject: [PATCH] scst/sysfs: Introduce scst_tgt_find_acg() Call scst_tgt_find_acg() instead of iterating explicitly over the ACG list. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4377 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index df30d2da4..ea48a927e 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1830,7 +1830,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer, { int res, action; char *p, *pp; - struct scst_acg *a, *acg = NULL; + struct scst_acg *acg; enum { SCST_INI_GROUP_ACTION_CREATE = 1, SCST_INI_GROUP_ACTION_DEL = 2, @@ -1871,14 +1871,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer, goto out_unlock; } - list_for_each_entry(a, &tgt->tgt_acg_list, acg_list_entry) { - if (strcmp(a->acg_name, p) == 0) { - TRACE_DBG("group (acg) %p %s found", - a, a->acg_name); - acg = a; - break; - } - } + acg = scst_tgt_find_acg(tgt, p); switch (action) { case SCST_INI_GROUP_ACTION_CREATE: