Rename mcfrtc to rtc
[oweals/u-boot.git] / drivers / cfb_console.c
index aba4a0341bdacbdd14a92c624a6cd202364b57a6..9727aebbcb2ffe03f51f752add36e0ed9e97978c 100644 (file)
@@ -501,7 +501,7 @@ static void video_drawchars (int xx, int yy, unsigned char *s, int count)
 
 static inline void video_drawstring (int xx, int yy, unsigned char *s)
 {
-       video_drawchars (xx, yy, s, strlen (s));
+       video_drawchars (xx, yy, s, strlen ((char *)s));
 }
 
 /*****************************************************************************/
@@ -548,12 +548,12 @@ void console_cursor (int state)
                sprintf (info, " %02d:%02d:%02d ", tm.tm_hour, tm.tm_min,
                         tm.tm_sec);
                video_drawstring (VIDEO_VISIBLE_COLS - 10 * VIDEO_FONT_WIDTH,
-                                 VIDEO_INFO_Y, info);
+                                 VIDEO_INFO_Y, (uchar *)info);
 
                sprintf (info, "%02d.%02d.%04d", tm.tm_mday, tm.tm_mon,
                         tm.tm_year);
                video_drawstring (VIDEO_VISIBLE_COLS - 10 * VIDEO_FONT_WIDTH,
-                                 VIDEO_INFO_Y + 1 * VIDEO_FONT_HEIGHT, info);
+                                 VIDEO_INFO_Y + 1 * VIDEO_FONT_HEIGHT, (uchar *)info);
        }
 #endif
 
@@ -779,11 +779,18 @@ int video_display_bitmap (ulong bmp_image, int x, int y)
                 */
                len = CFG_VIDEO_LOGO_MAX_SIZE;
                dst = malloc(CFG_VIDEO_LOGO_MAX_SIZE);
+               if (dst == NULL) {
+                       printf("Error: malloc in gunzip failed!\n");
+                       return(1);
+               }
                if (gunzip(dst, CFG_VIDEO_LOGO_MAX_SIZE, (uchar *)bmp_image, &len) != 0) {
                        printf ("Error: no valid bmp or bmp.gz image at %lx\n", bmp_image);
                        free(dst);
                        return 1;
                }
+               if (len == CFG_VIDEO_LOGO_MAX_SIZE) {
+                       printf("Image could be truncated (increase CFG_VIDEO_LOGO_MAX_SIZE)!\n");
+               }
 
                /*
                 * Set addr to decompressed image
@@ -1112,7 +1119,7 @@ static void *video_logo (void)
        logo_plot (video_fb_address, VIDEO_COLS, 0, 0);
 
        sprintf (info, " %s", &version_string);
-       video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, info);
+       video_drawstring (VIDEO_INFO_X, VIDEO_INFO_Y, (uchar *)info);
 
 #ifdef CONFIG_CONSOLE_EXTRA_INFO
        {
@@ -1123,7 +1130,7 @@ static void *video_logo (void)
                        if (*info)
                                video_drawstring (VIDEO_INFO_X,
                                                  VIDEO_INFO_Y + i * VIDEO_FONT_HEIGHT,
-                                                 info);
+                                                 (uchar *)info);
                }
        }
 #endif