提交 013af857 编写于 作者: S Steffen Maier 提交者: Martin K. Petersen

scsi: zfcp: zfcp_erp_action_exists() does only check for running

Simplify its signature to return boolean and rename it to
zfcp_erp_action_is_running() to indicate its actual unmodified semantics.
It has always been used like this since v2.6.0 history commit ea127f975424
("[PATCH] s390 (7/7): zfcp host adapter.").
Signed-off-by: NSteffen Maier <maier@linux.ibm.com>
Reviewed-by: NBenjamin Block <bblock@linux.ibm.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 cd4a186a
...@@ -57,10 +57,6 @@ enum zfcp_erp_act_type { ...@@ -57,10 +57,6 @@ enum zfcp_erp_act_type {
ZFCP_ERP_ACTION_FAILED = 0xe0, ZFCP_ERP_ACTION_FAILED = 0xe0,
}; };
enum zfcp_erp_act_state {
ZFCP_ERP_ACTION_RUNNING = 1,
};
enum zfcp_erp_act_result { enum zfcp_erp_act_result {
ZFCP_ERP_SUCCEEDED = 0, ZFCP_ERP_SUCCEEDED = 0,
ZFCP_ERP_FAILED = 1, ZFCP_ERP_FAILED = 1,
...@@ -76,14 +72,14 @@ static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask) ...@@ -76,14 +72,14 @@ static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask)
ZFCP_STATUS_COMMON_UNBLOCKED | mask); ZFCP_STATUS_COMMON_UNBLOCKED | mask);
} }
static int zfcp_erp_action_exists(struct zfcp_erp_action *act) static bool zfcp_erp_action_is_running(struct zfcp_erp_action *act)
{ {
struct zfcp_erp_action *curr_act; struct zfcp_erp_action *curr_act;
list_for_each_entry(curr_act, &act->adapter->erp_running_head, list) list_for_each_entry(curr_act, &act->adapter->erp_running_head, list)
if (act == curr_act) if (act == curr_act)
return ZFCP_ERP_ACTION_RUNNING; return true;
return 0; return false;
} }
static void zfcp_erp_action_ready(struct zfcp_erp_action *act) static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
...@@ -99,7 +95,7 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act) ...@@ -99,7 +95,7 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act)
{ {
act->status |= ZFCP_STATUS_ERP_DISMISSED; act->status |= ZFCP_STATUS_ERP_DISMISSED;
if (zfcp_erp_action_exists(act) == ZFCP_ERP_ACTION_RUNNING) if (zfcp_erp_action_is_running(act))
zfcp_erp_action_ready(act); zfcp_erp_action_ready(act);
} }
...@@ -622,7 +618,7 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) ...@@ -622,7 +618,7 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask)
unsigned long flags; unsigned long flags;
write_lock_irqsave(&adapter->erp_lock, flags); write_lock_irqsave(&adapter->erp_lock, flags);
if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) { if (zfcp_erp_action_is_running(erp_action)) {
erp_action->status |= set_mask; erp_action->status |= set_mask;
zfcp_erp_action_ready(erp_action); zfcp_erp_action_ready(erp_action);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册