This is an automated email from Gerrit.

Spencer Oliver ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/781

-- gerrit

commit 24849d4192e9f0f3f6f34f79291aced8a8a67f14
Author: Spencer Oliver <[email protected]>
Date:   Thu Aug 16 11:05:47 2012 +0100

    target: remove unused working area 'user' field
    
    working_area::user has never been used so lets remove it.
    
    Change-Id: I1200311b34248549c1fe30c9f675e6129b7bebee
    Signed-off-by: Spencer Oliver <[email protected]>

diff --git a/src/target/target.c b/src/target/target.c
index b8e4c2f..c71c536 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1405,7 +1405,6 @@ static void target_split_working_area(struct working_area 
*area, uint32_t size)
                new_wa->size = area->size - size;
                new_wa->address = area->address + size;
                new_wa->backup = NULL;
-               new_wa->user = NULL;
                new_wa->free = true;
 
                area->next = new_wa;
@@ -1494,7 +1493,6 @@ int target_alloc_working_area_try(struct target *target, 
uint32_t size, struct w
                        new_wa->size = target->working_area_size & ~3UL; /* 
4-byte align */
                        new_wa->address = target->working_area;
                        new_wa->backup = NULL;
-                       new_wa->user = NULL;
                        new_wa->free = true;
                }
 
@@ -1538,9 +1536,6 @@ int target_alloc_working_area_try(struct target *target, 
uint32_t size, struct w
        c->free = false;
        *area = c;
 
-       /* user pointer */
-       c->user = area;
-
        print_wa_layout(target);
 
        return ERROR_OK;
@@ -1591,13 +1586,6 @@ static int target_free_working_area_restore(struct 
target *target, struct workin
        LOG_DEBUG("freed %"PRIu32" bytes of working area at address 
0x%08"PRIx32,
                        area->size, area->address);
 
-       /* mark user pointer invalid */
-       /* TODO: Is this really safe? It points to some previous caller's 
memory.
-        * How could we know that the area pointer is still in that place and 
not
-        * some other vital data? What's the purpose of this, anyway? */
-       *area->user = NULL;
-       area->user = NULL;
-
        target_merge_working_areas(target);
 
        print_wa_layout(target);
@@ -1625,8 +1613,6 @@ static void target_free_all_working_areas_restore(struct 
target *target, int res
                        if (restore)
                                target_restore_working_area(target, c);
                        c->free = true;
-                       *c->user = NULL; /* Same as above */
-                       c->user = NULL;
                }
                c = c->next;
        }
diff --git a/src/target/target.h b/src/target/target.h
index 9707bcc..a610cd0 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -95,7 +95,6 @@ struct working_area {
        uint32_t size;
        bool free;
        uint8_t *backup;
-       struct working_area **user;
        struct working_area *next;
 };
 

-- 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to