From: Masahiro Yamada Date: Thu, 10 Jul 2014 19:06:50 +0900 Subject: [U-Boot] [PATCH 2/6] serial: add UniPhier serial driver In-Reply-To: <201407041640.29293.marex@denx.de> References: <1404469158-22703-3-git-send-email-yamada.m@jp.panasonic.com> <201407041640.29293.marex@denx.de> Message-ID: <20140710190650.CCBF.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On Fri, 4 Jul 2014 16:40:29 +0200 Marek Vasut wrote: > > +static void uniphier_serial_init(struct uniphier_serial *port) > > +{ > > + writeb(UART_LCR_WLS_8, &port->lcr); > > + > > +#define MODE_X_DIV 16 > > You can use just const unsigned here instead of #define. I adjusted drivers/serial/serial_ns16550.c for my own. Is using a macro here so bad? If so, should I also fix the line 138 of drivers/serial/serial_ns16550.c ? > > +static void uniphier_serial_putc(struct uniphier_serial *port, const char > > c) +{ > > + if (c == '\n') > > + uniphier_serial_putc(port, '\r'); > > + > > + while (!(readb(&port->lsr) & UART_LSR_THRE)) > > + ; > > I think in this function, you can avoid such completely unbounded loop. > > [...] Why? Could you give me more detailed explanation? Best Regards Masahiro Yamada