The generated header bmp_logo.h is useful even outside common/lcd.c for
the logo dimension.  However, the problem is, the generated bmp_logo.h
cannot be included multiple times because bmp_logo_palette[] and
bmp_logo_bitmap[] are defined in the bmp_logo.h.

We may remedy this by adding
  static __attribute__((unused))
to the array definitions so that bmp_logo.h can be included multiple
times, and these arrays is used in only one inclusion (lcd.c).

Signed-off-by: Che-Liang Chiou <clch...@chromium.org>
---

Changes in V3
  Add to the patch set

 tools/bmp_logo.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/bmp_logo.c b/tools/bmp_logo.c
index 47228d2..3d11284 100644
--- a/tools/bmp_logo.c
+++ b/tools/bmp_logo.c
@@ -113,7 +113,8 @@ int main (int argc, char *argv[])
                error ("Error allocating memory for file", fp);
 
        /* read and print the palette information */
-       printf ("unsigned short bmp_logo_palette[] = {\n");
+       printf("static __attribute__((unused)) "
+                       "unsigned short bmp_logo_palette[] = {\n");
 
        for (i=0; i<n_colors; ++i) {
                b->palette[(int)(i*3+2)] = fgetc(fp);
@@ -137,7 +138,8 @@ int main (int argc, char *argv[])
        printf ("\n");
        printf ("};\n");
        printf ("\n");
-       printf ("unsigned char bmp_logo_bitmap[] = {\n");
+       printf("static __attribute__((unused)) "
+                       "unsigned char bmp_logo_bitmap[] = {\n");
        for (i=(b->height-1)*b->width; i>=0; i-=b->width) {
                for (x = 0; x < b->width; x++) {
                        b->data[(uint16_t) i + x] = (uint8_t) fgetc (fp) \
-- 
1.7.3.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to