Skip to content

Commit fa4300f

Browse files
frowandrobherring
authored andcommitted
of: unittest: update text of expected warnings
The text of various warning messages triggered by unittest has changed. Update the text of expected warnings to match. The expected vs actual warnings are most easily seen by filtering the boot console messages with the of_unittest_expect program at https://github.com/frowand/dt_tools.git. The filter prefixes problem lines with '***', and prefixes lines that match expected errors with 'ok '. All other lines are prefixed with ' '. Unrelated lines have been deleted in the following examples. The mismatch appears as: -> ### dt-test ### start of unittest - you will see error messages OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1 OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1 OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found -1 platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found ** of_unittest_expect WARNING - not found ---> platform testcase-data:testcase-device2: IRQ index 0 not found -> ### dt-test ### end of unittest - 254 passed, 0 failed ** EXPECT statistics: ** ** EXPECT found : 42 ** EXPECT not found : 4 With this commit applied, the mismatch is resolved: -> ### dt-test ### start of unittest - you will see error messages ok OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ok OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ok OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1 ok platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found -> ### dt-test ### end of unittest - 254 passed, 0 failed ** EXPECT statistics: ** ** EXPECT found : 46 ** EXPECT not found : 0 Fixes: 2043727 ("driver core: platform: Make use of the helper function dev_err_probe()") Fixes: 94a4950 ("of: base: Fix phandle argument length mismatch error message") Signed-off-by: Frank Rowand <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e783362 commit fa4300f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/of/unittest.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,24 +513,24 @@ static void __init of_unittest_parse_phandle_with_args(void)
513513
memset(&args, 0, sizeof(args));
514514

515515
EXPECT_BEGIN(KERN_INFO,
516-
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1");
516+
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1");
517517

518518
rc = of_parse_phandle_with_args(np, "phandle-list-bad-args",
519519
"#phandle-cells", 1, &args);
520520

521521
EXPECT_END(KERN_INFO,
522-
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1");
522+
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1");
523523

524524
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
525525

526526
EXPECT_BEGIN(KERN_INFO,
527-
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1");
527+
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1");
528528

529529
rc = of_count_phandle_with_args(np, "phandle-list-bad-args",
530530
"#phandle-cells");
531531

532532
EXPECT_END(KERN_INFO,
533-
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1");
533+
"OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1");
534534

535535
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
536536
}
@@ -670,12 +670,12 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
670670
memset(&args, 0, sizeof(args));
671671

672672
EXPECT_BEGIN(KERN_INFO,
673-
"OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found -1");
673+
"OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1");
674674

675675
rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args",
676676
"phandle", 1, &args);
677677
EXPECT_END(KERN_INFO,
678-
"OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found -1");
678+
"OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1");
679679

680680
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
681681
}
@@ -1257,12 +1257,12 @@ static void __init of_unittest_platform_populate(void)
12571257
unittest(pdev, "device 2 creation failed\n");
12581258

12591259
EXPECT_BEGIN(KERN_INFO,
1260-
"platform testcase-data:testcase-device2: IRQ index 0 not found");
1260+
"platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found");
12611261

12621262
irq = platform_get_irq(pdev, 0);
12631263

12641264
EXPECT_END(KERN_INFO,
1265-
"platform testcase-data:testcase-device2: IRQ index 0 not found");
1265+
"platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found");
12661266

12671267
unittest(irq < 0 && irq != -EPROBE_DEFER,
12681268
"device parsing error failed - %d\n", irq);

0 commit comments

Comments
 (0)