summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-06-14 21:11:18 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2018-06-19 08:14:30 +0200
commit2ce790a829bdc3c80b03c01a64e2179042298c2e (patch)
treeabe1cd00dcf03c49b006a8dc021893d4646e8fd1 /common
parentfe040e0977fab29216f5039e8f9b04e6dbec859a (diff)
downloadbarebox-2ce790a829bdc3c80b03c01a64e2179042298c2e.tar.gz
barebox-2ce790a829bdc3c80b03c01a64e2179042298c2e.tar.xz
console: Fix console_get_first_active()
Fix if condition in console_get_first_active() to actually check that both bit are set. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/console_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/console_common.c b/common/console_common.c
index 00e020bd35..0131a1190a 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;
}