Skip to content

Commit 35df904

Browse files
geerturobherring
authored andcommitted
of: unittest: Improve messages and comments in apply/revert checks
Miscellaneous improvements for the apply and apply/revert checks, making them more similar: - Fix inverted comment for before state check, - Add more comments to improve symmetry, - Fix grammar s/must be to set to/must be in/, - Avoid saying "create" in messages, as the actual operation depends on the value of the before/after parameters. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/326ecfe0889c53d2cfff31b3bf950d0b70be225f.1690533838.git.geert+renesas@glider.be Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 8f50c20 commit 35df904

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/of/unittest.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,7 @@ static int __init of_unittest_apply_overlay_check(int overlay_nr,
21412141
{
21422142
int ret, ovcs_id;
21432143

2144-
/* unittest device must not be in before state */
2144+
/* unittest device must be in before state */
21452145
if (of_unittest_device_exists(unittest_nr, ovtype) != before) {
21462146
unittest(0, "%s with device @\"%s\" %s\n",
21472147
overlay_name_from_nr(overlay_nr),
@@ -2150,16 +2150,17 @@ static int __init of_unittest_apply_overlay_check(int overlay_nr,
21502150
return -EINVAL;
21512151
}
21522152

2153+
/* apply the overlay */
21532154
ovcs_id = 0;
21542155
ret = of_unittest_apply_overlay(overlay_nr, &ovcs_id);
21552156
if (ret != 0) {
21562157
/* of_unittest_apply_overlay already called unittest() */
21572158
return ret;
21582159
}
21592160

2160-
/* unittest device must be to set to after state */
2161+
/* unittest device must be in after state */
21612162
if (of_unittest_device_exists(unittest_nr, ovtype) != after) {
2162-
unittest(0, "%s failed to create @\"%s\" %s\n",
2163+
unittest(0, "%s with device @\"%s\" %s\n",
21632164
overlay_name_from_nr(overlay_nr),
21642165
unittest_path(unittest_nr, ovtype),
21652166
!after ? "enabled" : "disabled");
@@ -2195,13 +2196,14 @@ static int __init of_unittest_apply_revert_overlay_check(int overlay_nr,
21952196

21962197
/* unittest device must be in after state */
21972198
if (of_unittest_device_exists(unittest_nr, ovtype) != after) {
2198-
unittest(0, "%s failed to create @\"%s\" %s\n",
2199+
unittest(0, "%s with device @\"%s\" %s\n",
21992200
overlay_name_from_nr(overlay_nr),
22002201
unittest_path(unittest_nr, ovtype),
22012202
!after ? "enabled" : "disabled");
22022203
return -EINVAL;
22032204
}
22042205

2206+
/* remove the overlay */
22052207
save_ovcs_id = ovcs_id;
22062208
ret = of_overlay_remove(&ovcs_id);
22072209
if (ret != 0) {

0 commit comments

Comments
 (0)