From: Detlev Zundel Date: Tue, 02 Sep 2008 13:44:10 +0200 Subject: [U-Boot] [PATCH 2/5] atmel_lcdfb: Straighten out funky vl_sync logic In-Reply-To: <1220278882-26029-2-git-send-email-haavard.skinnemoen@atmel.com> (Haavard Skinnemoen's message of "Mon, 1 Sep 2008 16:21:19 +0200") References: <1220278882-26029-1-git-send-email-haavard.skinnemoen@atmel.com> <1220278882-26029-2-git-send-email-haavard.skinnemoen@atmel.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Haavard, > If the board _didn't_ request INVLINE_INVERTED, we set INVLINE_INVERTED, > otherwise we don't. WTF? > > Signed-off-by: Haavard Skinnemoen > --- > drivers/video/atmel_lcdfb.c | 5 +---- > 1 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c > index 7f0dceb..3a51cc7 100644 > --- a/drivers/video/atmel_lcdfb.c > +++ b/drivers/video/atmel_lcdfb.c > @@ -107,10 +107,7 @@ void lcd_ctrl_init(void *lcdbase) > if (panel_info.vl_tft) > value |= ATMEL_LCDC_DISTYPE_TFT; > > - if (!(panel_info.vl_sync & ATMEL_LCDC_INVLINE_INVERTED)) > - value |= ATMEL_LCDC_INVLINE_INVERTED; > - if (!(panel_info.vl_sync & ATMEL_LCDC_INVFRAME_INVERTED)) > - value |= ATMEL_LCDC_INVFRAME_INVERTED; > + value |= panel_info.vl_sync; What about value |= panel_info.vl_sync & (ATMEL_LCDC_INVLINE_INVERTED | ATMEL_LCDC_INVFRAME_INVERTED); [break lines where convenient] Apart from this being the formal equivalent to the original code, this would make it more clear what can go in, no? Cheers Detlev -- ["From 2.4 to 2.6 to 2.7" discussing release numbering of the Linux kernel] Let the bike-shed-painting begin. -- Linus Torvalds -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de