Skip to contentSkip to conversation

clang fixes

PATCH RESEND Applied Paolo Bonzini 2 participants 9 messages Feb 4, 2010 – Feb 25, 2010

lore
Share & tools
lore
#0 lore raw

v2 cover clang fixes

I removed the patch that malc NACKed.

Paolo Bonzini (5):
remove two dead assignments in target-i386/translate.c fix undefined shifts by >32
exec.c: dead assignments
vnc.c: remove dead code
usb-linux.c: remove write-only variable

 exec.c                  |    4 ----
 target-i386/translate.c |    2 --
 usb-linux.c             |    2 --
 vl.c                    |    4 ++--
 vnc.c                   |    3 ---
 5 files changed, 2 insertions(+), 13 deletions(-)
#1 lore raw

PATCH RESEND v2 1/5 remove two dead assignments in target-i386/translate.c

---
 target-i386/translate.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
target-i386/translate.c +0 -2
index 8078112..a597e80 100644
@@ -4692,8 +4692,6 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
             ot = dflag + OT_WORD;
 
         modrm = ldub_code(s->pc++);
-        mod = (modrm >> 6) & 3;
-        rm = (modrm & 7) | REX_B(s);
         reg = ((modrm >> 3) & 7) | rex_r;
 
         gen_ldst_modrm(s, modrm, ot, OR_TMP0, 0);
Signature · 1 line
1.6.6
#2 lore raw

PATCH RESEND v2 2/5 fix undefined shifts by >32

In reply to Paolo Bonzini

This one is for 0.12 too.

---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
index 39833fc..ea9a95c 100644
@@ -2380,9 +2380,9 @@ static void numa_add(const char *optarg)
                         fprintf(stderr,
                             "only 63 CPUs in NUMA mode supported.\n");
                     }
-                    value = (1 << (endvalue + 1)) - (1 << value);
+                    value = (2ULL << endvalue) - (1ULL << value);
                 } else {
-                    value = 1 << value;
+                    value = 1ULL << value;
                 }
             }
             node_cpumask[nodenr] = value;
Signature · 1 line
1.6.6
#3 lore raw

PATCH RESEND v2 2/5 fix undefined shifts by >32

Quoted 13 lines · Paolo Bonzini

This one is for 0.12 too.

---
  vl.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
vl.c +0 -0
index 39833fc..ea9a95c 100644
@@ -2380,9 +2380,9 @@ static void numa_add(const char *optarg)
                          fprintf(stderr,

vl.c static void numa_add(const char *optarg) · line 2388

Quoted 10 lines
vl.c +2 -2
                              "only 63 CPUs in NUMA mode supported.\n");
                      }
-                    value = (1<<  (endvalue + 1)) - (1<<  value);
+                    value = (2ULL<<  endvalue) - (1ULL<<  value);
                  } else {
-                    value = 1<<  value;
+                    value = 1ULL<<  value;
                  }
              }
              node_cpumask[nodenr] = value;

Ping for 0.12 (commit 0dfbd51).

Paolo

#4 lore raw

PATCH RESEND v2 3/5 exec.c: dead assignments

In reply to Paolo Bonzini
---
 exec.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
exec.c +0 -4
index 76831a1..b2a1cf1 100644
@@ -2489,17 +2489,13 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
 ram_addr_t qemu_ram_addr_from_host(void *ptr)
 {
     RAMBlock *prev;
-    RAMBlock **prevp;
     RAMBlock *block;
     uint8_t *host = ptr;
 
     prev = NULL;
-    prevp = &ram_blocks;
     block = ram_blocks;
     while (block && (block->host > host
                      || block->host + block->length <= host)) {
-        if (prev)
-          prevp = &prev->next;
         prev = block;
         block = block->next;
     }
Signature · 1 line
1.6.6
#5 lore raw

PATCH RESEND v2 4/5 vnc.c: remove dead code

In reply to Paolo Bonzini

to= is handled in qemu-sockets.c inet_listen.

---
 vnc.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
vnc.c +0 -3
index 92facde..a49cff2 100644
@@ -2537,7 +2537,6 @@ int vnc_display_open(DisplayState *ds, const char *display)
     const char *options;
     int password = 0;
     int reverse = 0;
-    int to_port = 0;
 #ifdef CONFIG_VNC_TLS
     int tls = 0, x509 = 0;
 #endif
@@ -2563,8 +2562,6 @@ int vnc_display_open(DisplayState *ds, const char *display)
             password = 1; /* Require password auth */
         } else if (strncmp(options, "reverse", 7) == 0) {
             reverse = 1;
-        } else if (strncmp(options, "to=", 3) == 0) {
-            to_port = atoi(options+3) + 5900;
 #ifdef CONFIG_VNC_SASL
         } else if (strncmp(options, "sasl", 4) == 0) {
             sasl = 1; /* Require SASL auth */
Signature · 1 line
1.6.6
#6 lore raw

PATCH RESEND v2 5/5 usb-linux.c: remove write-only variable

In reply to Paolo Bonzini
---
 usb-linux.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
usb-linux.c +0 -2
index 1aaa595..ba8facf 100644
@@ -1007,11 +1007,9 @@ USBDevice *usb_host_device_open(const char *devname)
 {
     struct USBAutoFilter filter;
     USBDevice *dev;
-    USBHostDevice *s;
     char *p;
 
     dev = usb_create(NULL /* FIXME */, "usb-host");
-    s = DO_UPCAST(USBHostDevice, dev, dev);
 
     if (strstr(devname, "auto:")) {
         if (parse_filter(devname, &filter) < 0)
Signature · 1 line
1.6.6
Applied
#7 lore raw
In reply to Paolo Bonzini

Thanks, applied.

Quoted 19 lines · Paolo Bonzini

I removed the patch that malc NACKed.

Paolo Bonzini (5):
 remove two dead assignments in target-i386/translate.c fix undefined shifts by >32
 exec.c: dead assignments
 vnc.c: remove dead code
 usb-linux.c: remove write-only variable

 exec.c                  |    4 ----
 target-i386/translate.c |    2 --
 usb-linux.c             |    2 --
 vl.c                    |    4 ++--
 vnc.c                   |    3 ---

 5 files changed, 2 insertions(+), 13 deletions(-)
#8 lore raw
Quoted 1 line · Blue Swirl

Thanks, applied.

Thanks Blue Swirl, can you please cherry-pick commit 0dfbd514 (fix undefined shifts by >32) into stable-0.12?

Paolo