Patchwork Cleanup dead code

login
register
mail settings
Submitter Jun Koi
Date April 9, 2010, 10:27 a.m.
Message ID <y2kfdaac4d51004090327z2db0c37rde6d72a93edcb03a@mail.gmail.com>
Download mbox | patch
Permalink /patch/49818/
State New
Headers show

Comments

Jun Koi - April 9, 2010, 10:27 a.m.
This patch removes some dead code in exec.c

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Blue Swirl - April 11, 2010, 8:25 p.m.
Thanks, applied.

On 4/9/10, Jun Koi <junkoi2004@gmail.com> wrote:
> This patch removes some dead code in exec.c
>
>  Signed-off-by: Jun Koi <junkoi2004@gmail.com>
>
>  diff --git a/exec.c b/exec.c
>  index 76163aa..43366ac 100644
>  --- a/exec.c
>  +++ b/exec.c
>  @@ -2884,15 +2884,12 @@ void *qemu_get_ram_ptr(ram_addr_t addr)
>     (typically a TLB entry) back to a ram offset.  */
>   ram_addr_t qemu_ram_addr_from_host(void *ptr)
>   {
>  -    RAMBlock *prev;
>      RAMBlock *block;
>      uint8_t *host = ptr;
>
>  -    prev = NULL;
>      block = ram_blocks;
>      while (block && (block->host > host
>                       || block->host + block->length <= host)) {
>  -        prev = block;
>          block = block->next;
>      }
>      if (!block) {
>
>
>

Patch

diff --git a/exec.c b/exec.c
index 76163aa..43366ac 100644
--- a/exec.c
+++ b/exec.c
@@ -2884,15 +2884,12 @@  void *qemu_get_ram_ptr(ram_addr_t addr)
    (typically a TLB entry) back to a ram offset.  */
 ram_addr_t qemu_ram_addr_from_host(void *ptr)
 {
-    RAMBlock *prev;
     RAMBlock *block;
     uint8_t *host = ptr;

-    prev = NULL;
     block = ram_blocks;
     while (block && (block->host > host
                      || block->host + block->length <= host)) {
-        prev = block;
         block = block->next;
     }
     if (!block) {