DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] staging: comedi: Simplify conditional evaluation
@ 2020-10-18 19:48 Deepak R Varma
  2020-10-18 19:49 ` [PATCH 2/2] staging: comedi: combine split lines for improved readability Deepak R Varma
  2020-10-19 10:17 ` [PATCH 1/2] staging: comedi: Simplify conditional evaluation Ian Abbott
  0 siblings, 2 replies; 10+ messages in thread
From: Deepak R Varma @ 2020-10-18 19:48 UTC (permalink / raw)
  To: outreachy-kernel, Greg Kroah-Hartman, Ian Abbott,
	H Hartley Sweeten, devel
  Cc: mh12gx2825

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

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
---
 drivers/staging/comedi/drivers/tests/ni_routes_test.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/tests/ni_routes_test.c b/drivers/staging/comedi/drivers/tests/ni_routes_test.c
index eaefaf596a37..7db83cf5e4aa 100644
--- a/drivers/staging/comedi/drivers/tests/ni_routes_test.c
+++ b/drivers/staging/comedi/drivers/tests/ni_routes_test.c
@@ -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");
 }
 
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-18 19:48 [PATCH 1/2] staging: comedi: Simplify conditional evaluation Deepak R Varma
2020-10-18 19:49 ` [PATCH 2/2] staging: comedi: combine split lines for improved readability Deepak R Varma
2020-10-19 10:22   ` Ian Abbott
2020-10-19 10:41     ` [Outreachy kernel] " Julia Lawall
2020-10-19 10:57       ` Deepak R Varma
2020-10-19 11:34         ` Ian Abbott
2020-10-19 11:49           ` Deepak R Varma
2020-10-19 12:46             ` Ian Abbott
2020-10-19 10:17 ` [PATCH 1/2] staging: comedi: Simplify conditional evaluation Ian Abbott
2020-10-19 10:51   ` Deepak R Varma

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git