]> git.proxmox.com Git - qemu.git/commitdiff
arm: remove dead assignments, spotted by clang analyzer
authorBlue Swirl <blauwirbel@gmail.com>
Sun, 25 Apr 2010 19:31:06 +0000 (19:31 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 25 Apr 2010 19:31:06 +0000 (19:31 +0000)
Value stored is never read.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 files changed:
arm-dis.c
hw/omap1.c
hw/omap2.c
hw/omap_sx1.c
hw/palm.c
hw/pflash_cfi01.c
hw/pflash_cfi02.c
hw/sd.c
hw/smc91c111.c
hw/spitz.c
hw/stellaris.c
hw/tusb6010.c
hw/wm8750.c
target-arm/translate.c

index 50285550c092639ede94dad3ef775a4bfa1044c7..fe7ac9984a562769bc16e744f2b3d66f7edf93eb 100644 (file)
--- a/arm-dis.c
+++ b/arm-dis.c
@@ -2515,7 +2515,6 @@ print_insn_neon (struct disassemble_info *info, long given, bfd_boolean thumb)
                          {
                            func (stream, "<illegal constant %.8x:%x:%x>",
                                   bits, cmode, op);
-                            size = 32;
                            break;
                          }
                         switch (size)
index a554d905f2fdba3623ac28f429943ce3f65fe360..8649dbdab3b73d2134fbf93d1950f6054b359904 100644 (file)
@@ -2348,7 +2348,6 @@ static void omap_clkm_write(void *opaque, target_phys_addr_t addr,
         return;
 
     case 0x0c: /* ARM_EWUPCT */
-        diff = s->clkm.arm_ewupct ^ value;
         s->clkm.arm_ewupct = value & 0x003f;
         return;
 
index a3fa89d3ee278295a89d4e0a9e689a5c3362e7ae..bd1b35e661b4fe1f9015aad0431d6cebe9304efb 100644 (file)
@@ -1968,7 +1968,7 @@ struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
 
     s->irq = irq;
     s->codec.rxdrq = *drq ++;
-    s->codec.txdrq = *drq ++;
+    s->codec.txdrq = *drq;
     omap_eac_reset(s);
 
 #ifdef HAS_AUDIO
index 2a8419e0b2422f96b3121d73889eb144e0d9e3b8..ca0a7d1005cdb8265eed27e9885f740fc2b50391 100644 (file)
@@ -126,7 +126,6 @@ static void sx1_init(ram_addr_t ram_size,
     static uint32_t cs1val = 0x00215070;
     static uint32_t cs2val = 0x00001139;
     static uint32_t cs3val = 0x00001139;
-    ram_addr_t phys_flash;
     DriveInfo *dinfo;
     int fl_idx;
     uint32_t flash_size = flash0_size;
@@ -140,7 +139,7 @@ static void sx1_init(ram_addr_t ram_size,
 
     /* External Flash (EMIFS) */
     cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
-                    (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM);
+                                 qemu_ram_alloc(flash_size) | IO_MEM_ROM);
 
     io = cpu_register_io_memory(static_readfn, static_writefn, &cs0val);
     cpu_register_physical_memory(OMAP_CS0_BASE + flash_size,
@@ -171,8 +170,7 @@ static void sx1_init(ram_addr_t ram_size,
     if ((version == 1) &&
             (dinfo = drive_get(IF_PFLASH, 0, fl_idx)) != NULL) {
         cpu_register_physical_memory(OMAP_CS1_BASE, flash1_size,
-                        (phys_flash = qemu_ram_alloc(flash1_size)) |
-                        IO_MEM_ROM);
+                                     qemu_ram_alloc(flash1_size) | IO_MEM_ROM);
         io = cpu_register_io_memory(static_readfn, static_writefn, &cs1val);
         cpu_register_physical_memory(OMAP_CS1_BASE + flash1_size,
                         OMAP_CS1_SIZE - flash1_size, io);
index 6d19167512f5f022c1630433c25cb716f97deda5..ba7c398a141c0b22f20fda9ba6a0cefd203e8ef5 100644 (file)
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -206,7 +206,6 @@ static void palmte_init(ram_addr_t ram_size,
     static uint32_t cs1val = 0x0000e1a0;
     static uint32_t cs2val = 0x0000e1a0;
     static uint32_t cs3val = 0xe1a0e1a0;
-    ram_addr_t phys_flash;
     int rom_size, rom_loaded = 0;
     DisplayState *ds = get_displaystate();
 
@@ -214,7 +213,7 @@ static void palmte_init(ram_addr_t ram_size,
 
     /* External Flash (EMIFS) */
     cpu_register_physical_memory(OMAP_CS0_BASE, flash_size,
-                    (phys_flash = qemu_ram_alloc(flash_size)) | IO_MEM_ROM);
+                    qemu_ram_alloc(flash_size) | IO_MEM_ROM);
 
     io = cpu_register_io_memory(static_readfn, static_writefn, &cs0val);
     cpu_register_physical_memory(OMAP_CS0_BASE + flash_size,
index 6b2adba87ddec8f82c7611674584d6e66755d360..20fe93d63c4db4356029f0323e0dfda1a34b96ff 100644 (file)
@@ -542,7 +542,9 @@ static int ctz32 (uint32_t n)
     }
     if (!(n & 0x1)) {
         ret++;
+#if 0 /* This is not necessary as n is never 0 */
         n = n >> 1;
+#endif
     }
 #if 0 /* This is not necessary as n is never 0 */
     if (!n)
index bd6397be2376c9b628cf52e8d7f36ddea9fff73f..f3d3f41a90f258613b5c0130b54c92d4d2042869 100644 (file)
@@ -582,7 +582,9 @@ static int ctz32 (uint32_t n)
     }
     if (!(n & 0x1)) {
         ret++;
+#if 0 /* This is not necessary as n is never 0 */
         n = n >> 1;
+#endif
     }
 #if 0 /* This is not necessary as n is never 0 */
     if (!n)
diff --git a/hw/sd.c b/hw/sd.c
index cc2839d1a56cf392faf7eab0625834ccdb99f8e2..c928120abd69bdc3c9bf1b6d27b1f328e5416d33 100644 (file)
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1143,12 +1143,8 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
 }
 
 static sd_rsp_type_t sd_app_command(SDState *sd,
-                                    SDRequest req) {
-    uint32_t rca;
-
-    if (sd_cmd_type[req.cmd] == sd_ac || sd_cmd_type[req.cmd] == sd_adtc)
-        rca = req.arg >> 16;
-
+                                    SDRequest req)
+{
     DPRINTF("ACMD%d 0x%08x\n", req.cmd, req.arg);
     switch (req.cmd) {
     case 6:    /* ACMD6:  SET_BUS_WIDTH */
index e4a24476e8f50b86d6e58733cac6b9b7e6bedd5d..f7d58e126281da213208132529272bf2b8490136 100644 (file)
@@ -160,7 +160,6 @@ static void smc91c111_do_tx(smc91c111_state *s)
     int i;
     int len;
     int control;
-    int add_crc;
     int packetnum;
     uint8_t *p;
 
@@ -187,20 +186,22 @@ static void smc91c111_do_tx(smc91c111_state *s)
             len = 64;
         }
 #if 0
-        /* The card is supposed to append the CRC to the frame.  However
-           none of the other network traffic has the CRC appended.
-           Suspect this is low level ethernet detail we don't need to worry
-           about.  */
-        add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
-        if (add_crc) {
-            uint32_t crc;
-
-            crc = crc32(~0, p, len);
-            memcpy(p + len, &crc, 4);
-            len += 4;
+        {
+            int add_crc;
+
+            /* The card is supposed to append the CRC to the frame.
+               However none of the other network traffic has the CRC
+               appended.  Suspect this is low level ethernet detail we
+               don't need to worry about.  */
+            add_crc = (control & 0x10) || (s->tcr & TCR_NOCRC) == 0;
+            if (add_crc) {
+                uint32_t crc;
+
+                crc = crc32(~0, p, len);
+                memcpy(p + len, &crc, 4);
+                len += 4;
+            }
         }
-#else
-        add_crc = 0;
 #endif
         if (s->ctr & CTR_AUTO_RELEASE)
             /* Race?  */
@@ -670,14 +671,14 @@ static ssize_t smc91c111_receive(VLANClientState *nc, const uint8_t *buf, size_t
         *(p++) = crc & 0xff; crc >>= 8;
         *(p++) = crc & 0xff; crc >>= 8;
         *(p++) = crc & 0xff; crc >>= 8;
-        *(p++) = crc & 0xff; crc >>= 8;
+        *(p++) = crc & 0xff;
     }
     if (size & 1) {
         *(p++) = buf[size - 1];
-        *(p++) = 0x60;
+        *p = 0x60;
     } else {
         *(p++) = 0;
-        *(p++) = 0x40;
+        *p = 0x40;
     }
     /* TODO: Raise early RX interrupt?  */
     s->int_level |= INT_RCV;
index 564519b2c7d7664f4a5288552da8bf1d9cc7c170..c3b5cd8e4fb5226ad3214bdce173f278627f687c 100644 (file)
@@ -721,7 +721,7 @@ static void spitz_ssp_attach(PXA2xxState *cpu)
     mux = ssi_create_slave(cpu->ssp[CORGI_SSP_PORT - 1], "corgi-ssp");
 
     bus = qdev_get_child_bus(mux, "ssi0");
-    dev = ssi_create_slave(bus, "spitz-lcdtg");
+    ssi_create_slave(bus, "spitz-lcdtg");
 
     bus = qdev_get_child_bus(mux, "ssi1");
     dev = ssi_create_slave(bus, "ads7846");
index 44c9eee5530f0791c3293ab6458877560ae06fb1..5755f8a9fc66dbed11ee3a7b5d48feddcdb70a98 100644 (file)
@@ -1367,7 +1367,7 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model,
             gpio_out[GPIO_D][0] = qdev_get_gpio_in(mux, 0);
 
             bus = qdev_get_child_bus(mux, "ssi0");
-            dev = ssi_create_slave(bus, "ssi-sd");
+            ssi_create_slave(bus, "ssi-sd");
 
             bus = qdev_get_child_bus(mux, "ssi1");
             dev = ssi_create_slave(bus, "ssd0323");
index 3887233339a0a75cc1c78dfa273f6fd0ca56fa81..4864be5e8d01ab5bfc22d70ff32190d74f62f86a 100644 (file)
@@ -425,7 +425,6 @@ static uint32_t tusb_async_readw(void *opaque, target_phys_addr_t addr)
         return s->rx_config[epnum];
     case TUSB_EP_MAX_PACKET_SIZE_OFFSET ...
             (TUSB_EP_MAX_PACKET_SIZE_OFFSET + 0x3b):
-        epnum = (offset - TUSB_EP_MAX_PACKET_SIZE_OFFSET) >> 2;
         return 0x00000000;     /* TODO */
     case TUSB_WAIT_COUNT:
         return 0x00;           /* TODO */
@@ -630,7 +629,6 @@ static void tusb_async_writew(void *opaque, target_phys_addr_t addr,
         break;
     case TUSB_EP_MAX_PACKET_SIZE_OFFSET ...
             (TUSB_EP_MAX_PACKET_SIZE_OFFSET + 0x3b):
-        epnum = (offset - TUSB_EP_MAX_PACKET_SIZE_OFFSET) >> 2;
         return;                /* TODO */
     case TUSB_WAIT_COUNT:
         return;                /* TODO */
index 6064da04134b6363d934e5958fc5d203c257e246..ce43c234ac7dd76190b5fa6eca5dcd8e61de3156 100644 (file)
@@ -62,12 +62,11 @@ static const uint8_t wm8750_vol_db_table[] = {
 
 static inline void wm8750_in_load(WM8750State *s)
 {
-    int acquired;
     if (s->idx_in + s->req_in <= sizeof(s->data_in))
         return;
     s->idx_in = audio_MAX(0, (int) sizeof(s->data_in) - s->req_in);
-    acquired = AUD_read(*s->in[0], s->data_in + s->idx_in,
-                    sizeof(s->data_in) - s->idx_in);
+    AUD_read(*s->in[0], s->data_in + s->idx_in,
+             sizeof(s->data_in) - s->idx_in);
 }
 
 static inline void wm8750_out_flush(WM8750State *s)
index 5c54919c38375875f5daf192cd4e0908a49f23ed..0eccca5cdbbd11e87e0564e834dad01ddc5d7725 100644 (file)
@@ -5242,7 +5242,6 @@ static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
             if (!u) {
                 /* Extract.  */
                 imm = (insn >> 8) & 0xf;
-                count = q + 1;
 
                 if (imm > 7 && !q)
                     return 1;