summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cli_hush.c8
-rw-r--r--common/cmd_fitupd.c14
-rw-r--r--common/dlmalloc.c2
-rw-r--r--common/image-fdt.c4
-rw-r--r--common/lcd.c24
-rw-r--r--common/usb_storage.c7
6 files changed, 19 insertions, 40 deletions
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 2b654b754f..d643912922 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -3162,7 +3162,7 @@ static int parse_stream_outer(struct in_str *inp, int flag)
o_string temp=NULL_O_STRING;
int rcode;
#ifdef __U_BOOT__
- int code = 0;
+ int code = 1;
#endif
do {
ctx.type = flag;
@@ -3217,7 +3217,7 @@ static int parse_stream_outer(struct in_str *inp, int flag)
}
b_free(&temp);
/* loop on syntax errors, return on EOF */
- } while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP) &&
+ } while (rcode != 1 && !(flag & FLAG_EXIT_FROM_LOOP) &&
(inp->peek != static_peek || b_peek(inp)));
#ifndef __U_BOOT__
return 0;
@@ -3236,8 +3236,10 @@ int parse_string_outer(const char *s, int flag)
#ifdef __U_BOOT__
char *p = NULL;
int rcode;
- if ( !s || !*s)
+ if (!s)
return 1;
+ if (!*s)
+ return 0;
if (!(p = strchr(s, '\n')) || *++p) {
p = xmalloc(strlen(s) + 2);
strcpy(p, s);
diff --git a/common/cmd_fitupd.c b/common/cmd_fitupd.c
index e811473b47..b0459744d9 100644
--- a/common/cmd_fitupd.c
+++ b/common/cmd_fitupd.c
@@ -1,12 +1,8 @@
-de <net.h>
-
-#if !defined(CONFIG_UPDATE_TFTP)
-#error "CONFIG_UPDATE_TFTP required"
-#endif
-
-static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
- ulong addr = 0Un the root directory of the source tree for details.
+/*
+ * (C) Copyright 2011
+ * Andreas Pretzsch, carpe noctem engineering, apr@cn-eng.de
+ *
+ * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index f9873393c1..d87834df67 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -2181,7 +2181,7 @@ Void_t* mALLOc(bytes) size_t bytes;
INTERNAL_SIZE_T nb;
#ifdef CONFIG_SYS_MALLOC_F_LEN
- if (!(gd->flags & GD_FLG_RELOC)) {
+ if (gd && !(gd->flags & GD_FLG_RELOC)) {
ulong new_ptr;
void *ptr;
diff --git a/common/image-fdt.c b/common/image-fdt.c
index a2342fa3df..a39ae1b4cc 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -413,11 +413,11 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
}
} else {
debug("## No Flattened Device Tree\n");
- return 0;
+ goto error;
}
} else {
debug("## No Flattened Device Tree\n");
- return 0;
+ goto error;
}
*of_flat_tree = fdt_blob;
diff --git a/common/lcd.c b/common/lcd.c
index 787d80e3cb..37147af805 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -881,7 +881,7 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb,
}
#endif
-#if defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
+#if defined(CONFIG_MPC823)
#define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++)
#else
#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++
@@ -906,9 +906,7 @@ static inline void fb_put_word(uchar **fb, uchar **from)
int lcd_display_bitmap(ulong bmp_image, int x, int y)
{
-#if !defined(CONFIG_MCC200)
ushort *cmap = NULL;
-#endif
ushort *cmap_base = NULL;
ushort i, j;
uchar *fb;
@@ -956,8 +954,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
debug("Display-bmp: %d x %d with %d colors\n",
(int)width, (int)height, (int)colors);
-#if !defined(CONFIG_MCC200)
- /* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
if (bmp_bpix == 8) {
cmap = configuration_get_cmap();
cmap_base = cmap;
@@ -985,24 +981,6 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
#endif
}
}
-#endif
- /*
- * BMP format for Monochrome assumes that the state of a
- * pixel is described on a per Bit basis, not per Byte.
- * So, in case of Monochrome BMP we should align widths
- * on a byte boundary and convert them from Bit to Byte
- * units.
- * Probably, PXA250 and MPC823 process 1bpp BMP images in
- * their own ways, so make the converting to be MCC200
- * specific.
- */
-#if defined(CONFIG_MCC200)
- if (bpix == 1) {
- width = ((width + 7) & ~7) >> 3;
- x = ((x + 7) & ~7) >> 3;
- pwidth= ((pwidth + 7) & ~7) >> 3;
- }
-#endif
padded_width = (width & 0x3 ? (width & ~0x3) + 4 : width);
diff --git a/common/usb_storage.c b/common/usb_storage.c
index eb7706c100..1411737bed 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1351,8 +1351,11 @@ int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
perq = usb_stor_buf[0];
modi = usb_stor_buf[1];
- if ((perq & 0x1f) == 0x1f) {
- /* skip unknown devices */
+ /*
+ * Skip unknown devices (0x1f) and enclosure service devices (0x0d),
+ * they would not respond to test_unit_ready .
+ */
+ if (((perq & 0x1f) == 0x1f) || ((perq & 0x1f) == 0x0d)) {
return 0;
}
if ((modi&0x80) == 0x80) {
OpenPOWER on IntegriCloud