From 20859ce978c492e9c649b4e1fb25d9f01843b475 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Wed, 22 Oct 2014 09:44:34 +0000 Subject: [PATCH] Change the initialisation of the newly allocated struct sched_lock object. Just memset the whole thing to 0. That avoids a cast that drops type qualifiction. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14650 --- coregrind/m_scheduler/ticket-lock-linux.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/coregrind/m_scheduler/ticket-lock-linux.c b/coregrind/m_scheduler/ticket-lock-linux.c index bfc8fac0d8..e94a6d4028 100644 --- a/coregrind/m_scheduler/ticket-lock-linux.c +++ b/coregrind/m_scheduler/ticket-lock-linux.c @@ -82,10 +82,7 @@ static struct sched_lock *create_sched_lock(void) // The futex syscall requires that a futex takes four bytes. vg_assert(sizeof(p->futex[0]) == 4); - p->head = 0; - p->tail = 0; - VG_(memset)((void*)p->futex, 0, sizeof(p->futex)); - p->owner = 0; + VG_(memset)(p, 0, sizeof(*p)); INNER_REQUEST(ANNOTATE_RWLOCK_CREATE(p)); INNER_REQUEST(ANNOTATE_BENIGN_RACE_SIZED(&p->futex, sizeof(p->futex), "")); -- 2.47.2