From patchwork Wed Mar 18 07:37:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 451239 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 281DD14009B for ; Wed, 18 Mar 2015 18:38:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C06CC4A04C; Wed, 18 Mar 2015 08:38:05 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CkrAOXdUT_YN; Wed, 18 Mar 2015 08:38:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0EB194B615; Wed, 18 Mar 2015 08:38:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FD1B4A033 for ; Wed, 18 Mar 2015 08:37:55 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DC_7i9HsHweg for ; Wed, 18 Mar 2015 08:37:55 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from s15287728.onlinehome-server.info (hamspirit.at [87.106.47.214]) by theia.denx.de (Postfix) with ESMTP id 43EF14A02F for ; Wed, 18 Mar 2015 08:37:51 +0100 (CET) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id 402C18F480C5; Wed, 18 Mar 2015 07:37:48 +0000 (UTC) Received: from s15287728.onlinehome-server.info ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MO+jvuIfjCas; Wed, 18 Mar 2015 07:37:42 +0000 (UTC) Received: from hannes-werkstatt.scm.lan (188-22-239-50.adsl.highway.telekom.at [188.22.239.50]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id E540E8F480C7; Wed, 18 Mar 2015 07:37:41 +0000 (UTC) From: Hannes Petermaier To: u-boot@lists.denx.de Date: Wed, 18 Mar 2015 08:37:20 +0100 Message-Id: <1426664243-30998-2-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1426664243-30998-1-git-send-email-oe5hpm@oevsv.at> References: <1426664243-30998-1-git-send-email-oe5hpm@oevsv.at> Cc: Tom Rini , sjg@google.com Subject: [U-Boot] [PATCH v2 1/4] common/lcd_console: cleanup lcd_drawchars/lcd_putc_xy X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Hannes Petermaier the capability of drawing some *str with count from lcd_drawchars is unnary. It is always called from lcd_putc_xy with one character of and count = 1. So we simply rename lcd_drawchars into lcd_putc_xy and remove the loops inside. Signed-off-by: Hannes Petermaier Signed-off-by: Hannes Petermaier --- Changes in v2: None common/lcd_console.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/common/lcd_console.c b/common/lcd_console.c index 8bf83b9..243b7c5 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -55,18 +55,17 @@ int lcd_get_screen_columns(void) return console_cols; } -static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) +static void lcd_putc_xy(ushort x, ushort y, char c) { uchar *dest; ushort row; int fg_color, bg_color; + int i; dest = (uchar *)(lcd_console_address + y * lcd_line_length + x * NBITS(LCD_BPP) / 8); for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) { - uchar *s = str; - int i; #if LCD_BPP == LCD_COLOR16 ushort *d = (ushort *)dest; #elif LCD_BPP == LCD_COLOR32 @@ -77,25 +76,17 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) fg_color = lcd_getfgcolor(); bg_color = lcd_getbgcolor(); - for (i = 0; i < count; ++i) { - uchar c, bits; - c = *s++; - bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; + uchar bits; + bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; - for (c = 0; c < 8; ++c) { - *d++ = (bits & 0x80) ? fg_color : bg_color; - bits <<= 1; - } + for (i = 0; i < 8; ++i) { + *d++ = (bits & 0x80) ? fg_color : bg_color; + bits <<= 1; } } } -static inline void lcd_putc_xy(ushort x, ushort y, uchar c) -{ - lcd_drawchars(x, y, &c, 1); -} - static void console_scrollup(void) { const int rows = CONFIG_CONSOLE_SCROLL_LINES;