mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 18:51:27 +00:00
ib_srpt: Convert two functions two single-exit style
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2380,11 +2380,12 @@ static struct srpt_tgt *srpt_convert_scst_tgt(struct scst_tgt *scst_tgt)
|
||||
static int srpt_enable_target(struct scst_tgt *scst_tgt, bool enable)
|
||||
{
|
||||
struct srpt_tgt *srpt_tgt = srpt_convert_scst_tgt(scst_tgt);
|
||||
int res = -E_TGT_PRIV_NOT_YET_SET;
|
||||
|
||||
EXTRACHECKS_WARN_ON_ONCE(irqs_disabled());
|
||||
|
||||
if (!srpt_tgt)
|
||||
return -E_TGT_PRIV_NOT_YET_SET;
|
||||
goto out;
|
||||
|
||||
TRACE_DBG("%s target %s", enable ? "Enabling" : "Disabling",
|
||||
scst_tgt->tgt_name);
|
||||
@@ -2395,7 +2396,10 @@ static int srpt_enable_target(struct scst_tgt *scst_tgt, bool enable)
|
||||
__srpt_close_all_ch(srpt_tgt);
|
||||
spin_unlock_irq(&srpt_tgt->spinlock);
|
||||
|
||||
return 0;
|
||||
res = 0;
|
||||
|
||||
out:
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2405,10 +2409,7 @@ static bool srpt_is_target_enabled(struct scst_tgt *scst_tgt)
|
||||
{
|
||||
struct srpt_tgt *srpt_tgt = srpt_convert_scst_tgt(scst_tgt);
|
||||
|
||||
if (srpt_tgt)
|
||||
return srpt_tgt->enabled;
|
||||
else
|
||||
return false;
|
||||
return srpt_tgt && srpt_tgt->enabled;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user