Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()")
Fixes: 94a4950a4acf ("of: base: Fix phandle argument length mismatch error message")
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220127192643.2534941-1-frowand.list@gmail.com

authored by

Frank Rowand and committed by
Rob Herring
fa4300f0 e783362e

+8 -8
+8 -8
drivers/of/unittest.c
··· 513 513 memset(&args, 0, sizeof(args)); 514 514 515 515 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"); 517 517 518 518 rc = of_parse_phandle_with_args(np, "phandle-list-bad-args", 519 519 "#phandle-cells", 1, &args); 520 520 521 521 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"); 523 523 524 524 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 525 525 526 526 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"); 528 528 529 529 rc = of_count_phandle_with_args(np, "phandle-list-bad-args", 530 530 "#phandle-cells"); 531 531 532 532 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"); 534 534 535 535 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 536 536 } ··· 670 670 memset(&args, 0, sizeof(args)); 671 671 672 672 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"); 674 674 675 675 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-args", 676 676 "phandle", 1, &args); 677 677 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"); 679 679 680 680 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 681 681 } ··· 1257 1257 unittest(pdev, "device 2 creation failed\n"); 1258 1258 1259 1259 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"); 1261 1261 1262 1262 irq = platform_get_irq(pdev, 0); 1263 1263 1264 1264 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"); 1266 1266 1267 1267 unittest(irq < 0 && irq != -EPROBE_DEFER, 1268 1268 "device parsing error failed - %d\n", irq);