[U-Boot] [PATCH 2/3] drivers/serial/serial.c: code maintainability improvments.
Kim Phillips
kim.phillips at freescale.com
Fri Apr 2 01:38:00 CEST 2010
On Thu, 1 Apr 2010 20:19:45 +0300
Michael Zaidman <michael.zaidman at gmail.com> wrote:
> +#define MAX_SER_PORTS ((sizeof(serial_ports)/sizeof(NS16550_t)))
one level of parens not needed, no space around operator '/'.
> +static inline void sanity_check(void)
we can avoid this non-function by placing the check in serial_init().
> +{
> + /* This will fail to compile if CONFIG_CONS_INDEX > MAX_SER_DEV */
> + BUILD_BUG_ON(CONFIG_CONS_INDEX > MAX_SER_PORTS);
the comment doesn't match the code, and the code looks pretty
self-explanatory in the first place. Remove the comment?
Kim
More information about the U-Boot
mailing list