From patchwork Sat Jan 27 16:21:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 866747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-89702-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="tJeILcs6"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zTLd60CQSz9s75 for ; Sun, 28 Jan 2018 03:21:45 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=XxgS3KqKbGtfS3sixylMo0Aon4SvUkJ2me+ZTDMq4ORui3cP5zth2 di1MZ2d8XKIf1WVHBL7WOK8C37Imo7bAoJNMw2GJFMNK6PDW34DyndNTYT3/PmvF zAQnXcfOPr60SUyH/RzQu88+J1erAM7CfIYNtOZaiJYoDiDFhIkuVM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=QEYgklp9SFKC9tXyJ+a37Jm/jwI=; b=tJeILcs6DTDyNV9mZhbOTjAG8nZN GtJMGpOAMV/4LdxNdLNltHfQ7eg+Cuj/KjCiwSGLiqHtxNKjl7d8JnvSL0DzyRXk mxkuQAbZ5o7NdsMNnRSn00XP7NzmY7w9aq4pGq3jmqEyLuFfGfTyGDKap/rJCeYh yLhxwHeozR/Ne4M= Received: (qmail 35133 invoked by alias); 27 Jan 2018 16:21:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 35123 invoked by uid 89); 27 Jan 2018 16:21:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=sk:applica, held X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited] hurd: fix warning Date: Sat, 27 Jan 2018 17:21:35 +0100 Message-Id: <20180127162135.28325-1-samuel.thibault@ens-lyon.org> timer_ptr2id and timer_id2ptr are used to convert between application-visible timer_t and struct timer_node *. timer_ptr2id was made to use void * instead of timer_t in 49b650430eb5 ('Update.') for no reason. It happens that on Linux timer_t is void *, so both that change and this commit are no-ops there, but not on systems where timer_t is not void *. Using timer_ptr2id for filling sival_ptr also does not make sense since that actually is a void *. * sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t instead of void *. * sysdeps/pthread/timer_create.c (timer_create): Do not use timer_ptr2id to cast struct timer_node * to void *. --- ChangeLog | 4 ++++ sysdeps/pthread/posix-timer.h | 2 +- sysdeps/pthread/timer_create.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2a771781e..497b00f65a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ return 0. * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): Cast vm_address_t * to ElfW(Addr) * for dl_main parameter. + * sysdeps/pthread/posix-timer.h (timer_ptr2id): Cast to timer_t + instead of void *. + * sysdeps/pthread/timer_create.c (timer_create): Do not use + timer_ptr2id to cast struct timer_node * to void *. 2018-01-27 James Clarke diff --git a/sysdeps/pthread/posix-timer.h b/sysdeps/pthread/posix-timer.h index 82311706d8..d7af9a017a 100644 --- a/sysdeps/pthread/posix-timer.h +++ b/sysdeps/pthread/posix-timer.h @@ -87,7 +87,7 @@ extern struct thread_node __timer_signal_thread_rclk; /* Return pointer to timer structure corresponding to ID. */ #define timer_id2ptr(timerid) ((struct timer_node *) timerid) -#define timer_ptr2id(timerid) ((void *) timerid) +#define timer_ptr2id(timerid) ((timer_t) timerid) /* Check whether timer is valid; global mutex must be held. */ static inline int diff --git a/sysdeps/pthread/timer_create.c b/sysdeps/pthread/timer_create.c index 1c80e6162f..2381a60d6f 100644 --- a/sysdeps/pthread/timer_create.c +++ b/sysdeps/pthread/timer_create.c @@ -77,7 +77,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) { newtimer->event.sigev_notify = SIGEV_SIGNAL; newtimer->event.sigev_signo = SIGALRM; - newtimer->event.sigev_value.sival_ptr = timer_ptr2id (newtimer); + newtimer->event.sigev_value.sival_ptr = newtimer; newtimer->event.sigev_notify_function = 0; }