[PATCH 09/27] console: Fix console_get_first_active()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix if condition in console_get_first_active() to actually check that
both bit are set.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 common/console_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/console_common.c b/common/console_common.c
index 00e020bd3..0131a1190 100644
--- a/common/console_common.c
+++ b/common/console_common.c
@@ -301,12 +301,13 @@ EXPORT_SYMBOL(console_get_by_name);
 struct console_device *console_get_first_active(void)
 {
 	struct console_device *cdev;
+	const unsigned char active = CONSOLE_STDIN | CONSOLE_STDOUT;
 	/*
 	 * Assumption to have BOTH CONSOLE_STDIN AND STDOUT in the
 	 * same output console
 	 */
 	for_each_console(cdev) {
-		if ((cdev->f_active & (CONSOLE_STDIN | CONSOLE_STDOUT)))
+		if ((cdev->f_active & active) == active)
 			return cdev;
 	}
 
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux