From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] global variables from comon/lcd.c
Date: Sat, 05 Jan 2013 20:40:19 +0100 [thread overview]
Message-ID: <20130105194019.BD2BF20077F@gemini.denx.de> (raw)
In-Reply-To: <50E86DFC.20304@myspectrum.nl>
Dear Jeroen,
In message <50E86DFC.20304@myspectrum.nl> you wrote:
>
> While looking at the common/lcd.c I fail to understand why it declares
> and uses global variables like lcd_color_fg, lcd_color_color_bg, lcd_base
> and relies on the drivers / boards to provide them, leading to code
> duplication. It also provides getters / setters for some of these variables.
>
> To me it seems more logical to have these variables in lcd.c itself. This
> construction has been around since at least 2004 though, so I tend to
> think I am missing something.
>
> Does someone know the reason why these variables are not part
> of lcd.c itself?
The code has gone through a number of more or heavy restructuring, so
it's difficult to tell what was the original design, and which might
just be incomplete cleanup or similar.
Fact is, that lcd_color_fg and lcd_color_color_bg are nowhere used
outside common/lcd.c - with a single exception: drivers/video/tegra.c
does a
color ^= lcd_color_fg;
once - but this should be trivial to fix by changing it into
color ^= lcd_getfgcolor();
Hm... guess I should submit a cleanup patch :-)
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Veni, Vidi, VISA:
I came, I saw, I did a little shopping.
next prev parent reply other threads:[~2013-01-05 19:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-05 18:16 [U-Boot] global variables from comon/lcd.c Jeroen Hofstee
2013-01-05 19:40 ` Wolfgang Denk [this message]
2013-01-05 19:45 ` [U-Boot] [PATCH] common/lcd.c: cleanup use of global variables Wolfgang Denk
2013-01-05 19:50 ` Wolfgang Denk
2013-01-06 22:43 ` Jeroen Hofstee
2013-01-12 17:07 ` Simon Glass
2013-01-06 23:33 ` Anatolij Gustschin
2013-01-12 17:06 ` Simon Glass
2013-01-25 21:26 ` Jeroen Hofstee
2013-03-29 10:56 ` Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130105194019.BD2BF20077F@gemini.denx.de \
--to=wd@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox