From: Florian Krohm Date: Wed, 22 Oct 2014 09:44:34 +0000 (+0000) Subject: Change the initialisation of the newly allocated struct sched_lock X-Git-Tag: svn/VALGRIND_3_11_0~898 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20859ce978c492e9c649b4e1fb25d9f01843b475;p=thirdparty%2Fvalgrind.git 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 --- 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), ""));