subsys: console: Fix the buffer size checking

Fix the problem that no compiler error even the buffer size is not power
of 2.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
This commit is contained in:
Aska Wu 2017-12-05 17:27:27 +08:00 committed by Anas Nashif
parent 7514178df4
commit fa934009cb

View file

@ -11,11 +11,11 @@
#include <drivers/console/console.h> #include <drivers/console/console.h>
#include <drivers/console/uart_console.h> #include <drivers/console/uart_console.h>
#if CONFIG_CONSOLE_GETCHAR_BUFSIZE & (CONFIG_CONSOLE_GETCHAR_BUFSIZE - 1) != 0 #if (CONFIG_CONSOLE_GETCHAR_BUFSIZE & (CONFIG_CONSOLE_GETCHAR_BUFSIZE - 1)) != 0
#error CONFIG_CONSOLE_GETCHAR_BUFSIZE must be power of 2 #error CONFIG_CONSOLE_GETCHAR_BUFSIZE must be power of 2
#endif #endif
#if CONFIG_CONSOLE_PUTCHAR_BUFSIZE & (CONFIG_CONSOLE_PUTCHAR_BUFSIZE - 1) != 0 #if (CONFIG_CONSOLE_PUTCHAR_BUFSIZE & (CONFIG_CONSOLE_PUTCHAR_BUFSIZE - 1)) != 0
#error CONFIG_CONSOLE_PUTCHAR_BUFSIZE must be power of 2 #error CONFIG_CONSOLE_PUTCHAR_BUFSIZE must be power of 2
#endif #endif