From fb2feef0c6f1fabd566fc8f0a3a6d0b93999fd2a Mon Sep 17 00:00:00 2001 From: uwe Date: Sun, 18 Dec 2005 19:09:26 +0000 Subject: [PATCH] Simplify j6x0lcd_contrast_raw. --- sys/arch/hpcsh/dev/j6x0lcd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/arch/hpcsh/dev/j6x0lcd.c b/sys/arch/hpcsh/dev/j6x0lcd.c index 3e0b81450d9a..17427800a344 100644 --- a/sys/arch/hpcsh/dev/j6x0lcd.c +++ b/sys/arch/hpcsh/dev/j6x0lcd.c @@ -1,4 +1,4 @@ -/* $NetBSD: j6x0lcd.c,v 1.9 2005/12/18 18:59:48 uwe Exp $ */ +/* $NetBSD: j6x0lcd.c,v 1.10 2005/12/18 19:09:26 uwe Exp $ */ /* * Copyright (c) 2004, 2005 Valeriy E. Ushakov @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: j6x0lcd.c,v 1.9 2005/12/18 18:59:48 uwe Exp $"); +__KERNEL_RCSID(0, "$NetBSD: j6x0lcd.c,v 1.10 2005/12/18 19:09:26 uwe Exp $"); #include #include @@ -289,14 +289,11 @@ j6x0lcd_contrast_raw(uint16_t bcr, int width, const uint8_t *pin) contrast = 0; for (bit = 0; bit < width; ++bit) { - unsigned int c, v; + unsigned int c; c = (bcr >> (pin[bit] << 1)) & 0x3; - if (c == 1) /* output mode? */ - v = 1; - else - v = 0; - contrast |= (v << bit); + if (c == 1) /* pin in output mode? */ + contrast |= (1 << bit); } return contrast;