summaryrefslogtreecommitdiffstats
path: root/libdm/mm
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2011-10-20 13:33:41 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2011-10-20 13:33:41 +0000
commite3359201cf9ca5b82ccf792a08f011601599c526 (patch)
treec92c1c9f37241d3fd829a50086a111c740aff1a9 /libdm/mm
parent909bc0fff121fe631426c784e1f201535fe59381 (diff)
downloadlvm2-e3359201cf9ca5b82ccf792a08f011601599c526.tar.gz
lvm2-e3359201cf9ca5b82ccf792a08f011601599c526.tar.xz
lvm2-e3359201cf9ca5b82ccf792a08f011601599c526.zip
Simplify some pointer operations
Diffstat (limited to 'libdm/mm')
-rw-r--r--libdm/mm/dbg_malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdm/mm/dbg_malloc.c b/libdm/mm/dbg_malloc.c
index db7f5f3e..cf8330cf 100644
--- a/libdm/mm/dbg_malloc.c
+++ b/libdm/mm/dbg_malloc.c
@@ -143,9 +143,9 @@ void dm_free_aux(void *p)
assert(mb->magic == p);
/* check data at the far boundary */
- ptr = ((char *) mb) + sizeof(struct memblock) + mb->length;
+ ptr = (char *) p + mb->length;
for (i = 0; i < sizeof(unsigned long); i++)
- if (*ptr++ != (char) mb->id)
+ if (ptr[i] != (char) mb->id)
assert(!"Damage at far end of block");
/* have we freed this before ? */
@@ -165,9 +165,9 @@ void dm_free_aux(void *p)
mb->id = 0;
/* stomp a different pattern across the memory */
- ptr = ((char *) mb) + sizeof(struct memblock);
+ ptr = p;
for (i = 0; i < mb->length; i++)
- *ptr++ = i & 1 ? (char) 0xde : (char) 0xad;
+ ptr[i] = i & 1 ? (char) 0xde : (char) 0xad;
assert(_mem_stats.blocks_allocated);
_mem_stats.blocks_allocated--;