]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - cmd/itest.c
misc: add support for Qualcomm SMD protocol
[karo-tx-uboot.git] / cmd / itest.c
index 91ae5c2704c882be8d4457d67d5f8488b19d2f1c..60626c7fe9c3d983d247aeee6f89b76548a189b5 100644 (file)
@@ -59,19 +59,19 @@ static long evalexp(char *s, int w)
        if (s[0] == '*') {
                addr = simple_strtoul(&s[1], NULL, 16);
                buf = map_physmem(addr, w, MAP_WRBACK);
-               if (!buf) {
+               if (!buf && addr) {
                        puts("Failed to map physical memory\n");
                        return 0;
                }
                switch (w) {
                case 1:
-                       l = (long)(*(unsigned char *)buf);
+                       l = (long)(*(u8 *)buf);
                        break;
                case 2:
-                       l = (long)(*(unsigned short *)buf);
+                       l = (long)(*(u16 *)buf);
                        break;
                case 4:
-                       l = (long)(*(unsigned long *)buf);
+                       l = (long)(*(u32 *)buf);
                        break;
                }
                unmap_physmem(buf, w);