Skip to content

Commit a80f36c

Browse files
David Kozubaxboe
authored andcommitted
block: sed-opal: rename next to execute_steps
As the function is responsible for executing the individual steps supplied in the steps argument, execute_steps is a more descriptive name than the rather generic next. Signed-off-by: David Kozub <zub@linux.fjfi.cvut.cz> Reviewed-by: Scott Bauer <sbauer@plzdonthack.me> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0af2648 commit a80f36c

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

‎block/sed-opal.c‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ static int execute_step(struct opal_dev *dev,
396396
return error;
397397
}
398398

399-
static int next(struct opal_dev *dev, const struct opal_step *steps,
400-
size_t n_steps)
399+
static int execute_steps(struct opal_dev *dev,
400+
const struct opal_step *steps, size_t n_steps)
401401
{
402402
size_t state = 0;
403403
int error;
@@ -1937,7 +1937,7 @@ static int opal_secure_erase_locking_range(struct opal_dev *dev,
19371937

19381938
mutex_lock(&dev->dev_lock);
19391939
setup_opal_dev(dev);
1940-
ret = next(dev, erase_steps, ARRAY_SIZE(erase_steps));
1940+
ret = execute_steps(dev, erase_steps, ARRAY_SIZE(erase_steps));
19411941
mutex_unlock(&dev->dev_lock);
19421942
return ret;
19431943
}
@@ -1954,7 +1954,7 @@ static int opal_erase_locking_range(struct opal_dev *dev,
19541954

19551955
mutex_lock(&dev->dev_lock);
19561956
setup_opal_dev(dev);
1957-
ret = next(dev, erase_steps, ARRAY_SIZE(erase_steps));
1957+
ret = execute_steps(dev, erase_steps, ARRAY_SIZE(erase_steps));
19581958
mutex_unlock(&dev->dev_lock);
19591959
return ret;
19601960
}
@@ -1981,7 +1981,7 @@ static int opal_enable_disable_shadow_mbr(struct opal_dev *dev,
19811981

19821982
mutex_lock(&dev->dev_lock);
19831983
setup_opal_dev(dev);
1984-
ret = next(dev, mbr_steps, ARRAY_SIZE(mbr_steps));
1984+
ret = execute_steps(dev, mbr_steps, ARRAY_SIZE(mbr_steps));
19851985
mutex_unlock(&dev->dev_lock);
19861986
return ret;
19871987
}
@@ -2033,7 +2033,7 @@ static int opal_add_user_to_lr(struct opal_dev *dev,
20332033

20342034
mutex_lock(&dev->dev_lock);
20352035
setup_opal_dev(dev);
2036-
ret = next(dev, steps, ARRAY_SIZE(steps));
2036+
ret = execute_steps(dev, steps, ARRAY_SIZE(steps));
20372037
mutex_unlock(&dev->dev_lock);
20382038
return ret;
20392039
}
@@ -2048,7 +2048,7 @@ static int opal_reverttper(struct opal_dev *dev, struct opal_key *opal)
20482048

20492049
mutex_lock(&dev->dev_lock);
20502050
setup_opal_dev(dev);
2051-
ret = next(dev, revert_steps, ARRAY_SIZE(revert_steps));
2051+
ret = execute_steps(dev, revert_steps, ARRAY_SIZE(revert_steps));
20522052
mutex_unlock(&dev->dev_lock);
20532053

20542054
/*
@@ -2076,10 +2076,11 @@ static int __opal_lock_unlock(struct opal_dev *dev,
20762076
};
20772077

20782078
if (lk_unlk->session.sum)
2079-
return next(dev, unlock_sum_steps,
2080-
ARRAY_SIZE(unlock_sum_steps));
2079+
return execute_steps(dev, unlock_sum_steps,
2080+
ARRAY_SIZE(unlock_sum_steps));
20812081
else
2082-
return next(dev, unlock_steps, ARRAY_SIZE(unlock_steps));
2082+
return execute_steps(dev, unlock_steps,
2083+
ARRAY_SIZE(unlock_steps));
20832084
}
20842085

20852086
static int __opal_set_mbr_done(struct opal_dev *dev, struct opal_key *key)
@@ -2091,7 +2092,7 @@ static int __opal_set_mbr_done(struct opal_dev *dev, struct opal_key *key)
20912092
{ end_opal_session, }
20922093
};
20932094

2094-
return next(dev, mbrdone_step, ARRAY_SIZE(mbrdone_step));
2095+
return execute_steps(dev, mbrdone_step, ARRAY_SIZE(mbrdone_step));
20952096
}
20962097

20972098
static int opal_lock_unlock(struct opal_dev *dev,
@@ -2126,7 +2127,7 @@ static int opal_take_ownership(struct opal_dev *dev, struct opal_key *opal)
21262127

21272128
mutex_lock(&dev->dev_lock);
21282129
setup_opal_dev(dev);
2129-
ret = next(dev, owner_steps, ARRAY_SIZE(owner_steps));
2130+
ret = execute_steps(dev, owner_steps, ARRAY_SIZE(owner_steps));
21302131
mutex_unlock(&dev->dev_lock);
21312132
return ret;
21322133
}
@@ -2147,7 +2148,7 @@ static int opal_activate_lsp(struct opal_dev *dev,
21472148

21482149
mutex_lock(&dev->dev_lock);
21492150
setup_opal_dev(dev);
2150-
ret = next(dev, active_steps, ARRAY_SIZE(active_steps));
2151+
ret = execute_steps(dev, active_steps, ARRAY_SIZE(active_steps));
21512152
mutex_unlock(&dev->dev_lock);
21522153
return ret;
21532154
}
@@ -2164,7 +2165,7 @@ static int opal_setup_locking_range(struct opal_dev *dev,
21642165

21652166
mutex_lock(&dev->dev_lock);
21662167
setup_opal_dev(dev);
2167-
ret = next(dev, lr_steps, ARRAY_SIZE(lr_steps));
2168+
ret = execute_steps(dev, lr_steps, ARRAY_SIZE(lr_steps));
21682169
mutex_unlock(&dev->dev_lock);
21692170
return ret;
21702171
}
@@ -2186,7 +2187,7 @@ static int opal_set_new_pw(struct opal_dev *dev, struct opal_new_pw *opal_pw)
21862187

21872188
mutex_lock(&dev->dev_lock);
21882189
setup_opal_dev(dev);
2189-
ret = next(dev, pw_steps, ARRAY_SIZE(pw_steps));
2190+
ret = execute_steps(dev, pw_steps, ARRAY_SIZE(pw_steps));
21902191
mutex_unlock(&dev->dev_lock);
21912192
return ret;
21922193
}
@@ -2210,7 +2211,7 @@ static int opal_activate_user(struct opal_dev *dev,
22102211

22112212
mutex_lock(&dev->dev_lock);
22122213
setup_opal_dev(dev);
2213-
ret = next(dev, act_steps, ARRAY_SIZE(act_steps));
2214+
ret = execute_steps(dev, act_steps, ARRAY_SIZE(act_steps));
22142215
mutex_unlock(&dev->dev_lock);
22152216
return ret;
22162217
}

0 commit comments

Comments
 (0)