Received: by 10.213.65.68 with SMTP id h4csp1743645imn; Sun, 1 Apr 2018 13:48:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx499NxZrAO5hDLkBj3ghYPGHEwJdeW2DlPhaQb22BfXWuwR+cbBvBKBHen8Dr8kxLuHkva4y X-Received: by 10.99.52.135 with SMTP id b129mr4566590pga.308.1522615685519; Sun, 01 Apr 2018 13:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522615685; cv=none; d=google.com; s=arc-20160816; b=mawKUAUlyDXhkJWxT2c+Nu59CXtRQASYcNXhFT1wA9w2FsppDMtF7aw6wFASQ9/Os7 RLLWhWK1R0XpMN1xyn0pyjkNT+kXaDzFhXk+tQYVUV27VyQ33pEy0hozWW2+C2P4sLa7 8L29nmKzMDkdferk5Kw+BBCtIpM4SGSp6zuZPKKw2gYATLGJo6Rgs+LYjHvAK7TSmyQG n94z5xMo5oGud2ogqS+Lu6rlkQEJXMHkM/u2ZoK57azHC74QGyGACiMbWdpOauT+kG0r TUjWu37YLdPmpFPgSezoIoKqf2jaEc7gMkhBqu00H/4L18nLCVBCsHr0PC6xjzApy6ED Lqng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject :organization:arc-authentication-results; bh=wlm8X5fJboO1tpr8px5BWUd/JvTqX8tV2jWw7J33DJg=; b=zaaanWgcz/+mV717VLP1o5o1qF+wTBmL+r8UBxWuVIuXB0jylOPZsgItpmCjOl+Rqi f7hFAiVWlGVqD+ZX2eyQpfJUUkQuTZ31qLl6Y8JOUdxF/OErISPGoXaBJ4wqAJ1wHXBS 6yVJpfBkhCIwRaG9hSo3niIFJtwOP0cByms0buwAVZVPA58gMpQaFwWjmxQjmC3CaH0T 5oUAMoFVe/FdG7MyoaS55k4pXrVONHhKV0BxhzCKbKxJzs/8A85J3wL40+CSZ9NZrc4o /UdRS+B+/1asvAaoz4ZywoymHE24COYxSV0uc3n+H+19JlOPOtsMKbUCyc5TIcViojgs haeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z123si8777869pgb.466.2018.04.01.13.47.52; Sun, 01 Apr 2018 13:48:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754577AbeDAUnp (ORCPT + 99 others); Sun, 1 Apr 2018 16:43:45 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38262 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753901AbeDAUnl (ORCPT ); Sun, 1 Apr 2018 16:43:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9B7BE4070214 for ; Sun, 1 Apr 2018 20:43:40 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-59.rdu2.redhat.com [10.10.120.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34462215CDAC; Sun, 1 Apr 2018 20:43:40 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 34/45] C++: Fix up use of LIST_POISON* From: David Howells To: linux-kernel@vger.kernel.org Date: Sun, 01 Apr 2018 21:43:39 +0100 Message-ID: <152261541968.30503.6809876330515224199.stgit@warthog.procyon.org.uk> In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Sun, 01 Apr 2018 20:43:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Sun, 01 Apr 2018 20:43:40 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dhowells@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implicitly casting void* to a non-void pointer is frowned upon in C++, though -fpermissive causes it to be accepted. Fix up LIST_POISON1/2 somewhat to handle this a bit better. Signed-off-by: David Howells --- include/linux/list.h | 8 ++++---- include/linux/list_bl.h | 4 ++-- include/linux/list_nulls.h | 2 +- include/linux/poison.h | 6 ++++-- include/linux/rculist.h | 4 ++-- include/linux/rculist_bl.h | 2 +- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/linux/list.h b/include/linux/list.h index 4b129df4d46b..6aa933e4b109 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -123,8 +123,8 @@ static inline void __list_del_entry(struct list_head *entry) static inline void list_del(struct list_head *entry) { __list_del_entry(entry); - entry->next = LIST_POISON1; - entry->prev = LIST_POISON2; + entry->next = static_cast(LIST_POISON1); + entry->prev = static_cast(LIST_POISON2); } /** @@ -654,8 +654,8 @@ static inline void __hlist_del(struct hlist_node *n) static inline void hlist_del(struct hlist_node *n) { __hlist_del(n); - n->next = LIST_POISON1; - n->pprev = LIST_POISON2; + n->next = HLIST_POISON1; + n->pprev = HLIST_POISON2; } static inline void hlist_del_init(struct hlist_node *n) diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index 3fc2cc57ba1b..474c87c2e72e 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -105,8 +105,8 @@ static inline void __hlist_bl_del(struct hlist_bl_node *n) static inline void hlist_bl_del(struct hlist_bl_node *n) { __hlist_bl_del(n); - n->next = LIST_POISON1; - n->pprev = LIST_POISON2; + n->next = ((struct hlist_bl_node *) (0x100 + POISON_POINTER_DELTA)); + n->pprev = ((struct hlist_bl_node **) (0x200 + POISON_POINTER_DELTA)); } static inline void hlist_bl_del_init(struct hlist_bl_node *n) diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 3ef96743db8d..6c471fd62c9c 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h @@ -91,7 +91,7 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) static inline void hlist_nulls_del(struct hlist_nulls_node *n) { __hlist_nulls_del(n); - n->pprev = LIST_POISON2; + n->pprev = (struct hlist_nulls_node **)LIST_POISON2; } /** diff --git a/include/linux/poison.h b/include/linux/poison.h index 15927ebc22f2..21544c2bf1a7 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h @@ -20,8 +20,10 @@ * under normal circumstances, used to verify that nobody uses * non-initialized list entries. */ -#define LIST_POISON1 ((void *) 0x100 + POISON_POINTER_DELTA) -#define LIST_POISON2 ((void *) 0x200 + POISON_POINTER_DELTA) +#define LIST_POISON1 ((struct list_head *) (0x100 + POISON_POINTER_DELTA)) +#define LIST_POISON2 ((struct list_head *) (0x200 + POISON_POINTER_DELTA)) +#define HLIST_POISON1 ((struct hlist_node *) (0x100 + POISON_POINTER_DELTA)) +#define HLIST_POISON2 ((struct hlist_node **) (0x200 + POISON_POINTER_DELTA)) /********** include/linux/timer.h **********/ /* diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 127f534fec94..d7b6a0a697c8 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h @@ -425,7 +425,7 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, static inline void hlist_del_rcu(struct hlist_node *n) { __hlist_del(n); - n->pprev = LIST_POISON2; + n->pprev = HLIST_POISON2; } /** @@ -445,7 +445,7 @@ static inline void hlist_replace_rcu(struct hlist_node *old, rcu_assign_pointer(*(struct hlist_node __rcu **)new->pprev, new); if (next) new->next->pprev = &new->next; - old->pprev = LIST_POISON2; + old->pprev = HLIST_POISON2; } /* diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index 66e73ec1aa99..e5a2c59deb6d 100644 --- a/include/linux/rculist_bl.h +++ b/include/linux/rculist_bl.h @@ -74,7 +74,7 @@ static inline void hlist_bl_del_init_rcu(struct hlist_bl_node *n) static inline void hlist_bl_del_rcu(struct hlist_bl_node *n) { __hlist_bl_del(n); - n->pprev = LIST_POISON2; + n->pprev = ((struct hlist_bl_node **) (0x200 + POISON_POINTER_DELTA)); } /**