staging: comedi: tests: Simplify conditional evaluation
PATCH v3 1/1 staging: comedi: tests: Simplify conditional evaluation
Boolean comparison of the condition inside unittest function is unnecessary and can be simplified by directly using the condition outcome for evaluation. Issue reported by :scripts/coccinelle/misc/boolinit.cocci
---
Changes since v2:
- Update patch subject to include tests tag as well to be more informative of the scope of change. Suggested by Ian Abbott.
Changes since v1:
- Corrected wrongly inverted tests. Feedback from Ian Abbott.
- Note:
This patch was sent earlier as part of a patch set containing 2 patches. The second patch of the patch set is dropped. Hence sending this standalone patch as v2 version. This is based on the feedback from Ian Abbott and Julia L.
drivers/staging/comedi/drivers/tests/ni_routes_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/comedi/drivers/tests/ni_routes_test.c +4 -4
@@ -499,13 +499,13 @@ void test_route_register_is_valid(void)const struct ni_route_tables *T = &private.routing_tables;init_pci_fake (); -unittest (route_register_is_valid (4 ,O (4 ),T ) == false, +unittest (!route_register_is_valid (4 ,O (4 ),T ),"check for bad source 4-->4\n" ); -unittest (route_register_is_valid (0 ,O (1 ),T ) == true, +unittest (route_register_is_valid (0 ,O (1 ),T ),"find first source\n" ); -unittest (route_register_is_valid (4 ,O (6 ),T ) == true, +unittest (route_register_is_valid (4 ,O (6 ),T ),"find middle source\n" ); -unittest (route_register_is_valid (9 ,O (8 ),T ) == true, +unittest (route_register_is_valid (9 ,O (8 ),T ),"find last source" ); }
Signature · 1 line
2.25.1