Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1276770imu; Wed, 9 Jan 2019 15:07:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN4puAkrtKpU0CcDVYwItEU7Vg9iYP0Pr5RcPtKMO29iyZr34T0doWHe5iPfHuvTkJYwQrUO X-Received: by 2002:a17:902:2862:: with SMTP id e89mr8063322plb.158.1547075262320; Wed, 09 Jan 2019 15:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547075262; cv=none; d=google.com; s=arc-20160816; b=a3Qp1VO6d5TlBitG4GJXCEKxTylmKGf/mYWL1BxsMzCnOXFHwh71Jx4nXnRAxu00H7 gH62DAGcrj8WHdnbYqgPJs8N4PHh5D0QhBNlRSSNfbputJANOmQpOzS3kJM4mW6Bb1el ysP7syY6Yh2KxGMTTSg4gStLXFgKtaVnM6w7DEADEPnVDALo1gCrzDDvOa90LwGDQwsB EFB4fP4KGRWCuO74BcVc8y/CBxovGjRUV4mMxHAudtlyOMOxq0g43DvCBjJQSz1q5Bf+ 5q3oLmD5asuzheiBkAFL1Odzc7pMPon0PVidzMnMapSaMttQnWJReyUc6EZ8d0i1aofp xomg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=VDXA57I2+gWTFtdUJtBrPHZE5V4HE9DhDyKkFTIZZ64=; b=fnmunzMTc/7hyXw1AmZuWk1p4oiZ5XZ0y8M2Ss3jUqHg+zlqFweQ2n3Oe/hHzkMCL7 KdKqBLSf+4nTEN5L1MkHG/PQpkunHj16pYVM6ZWrWvOo4qs0B0Uvx9ZTwb37vU+JrzWF 6DR8W4QX4xM/08r9M7LkCTIugWSmHNg3wG0hGUW5luDMJBnbgBbuho/xAISSIiUsPl8I nstoL6ZIzEfnTLhAJU0OOFZpWzArdtlHF0LRIY4R9J0OVzDMbUx/x11y8J5w9hNktYtq jdDaF57jAH9FdB4wHnBddxU3TSlpezw3FoOGinXtOPkFlaX8q9t70zhuVxns0fbfZcl1 ViFw== 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 c1si12791360pld.194.2019.01.09.15.07.26; Wed, 09 Jan 2019 15:07:42 -0800 (PST) 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 S1726793AbfAIW74 (ORCPT + 99 others); Wed, 9 Jan 2019 17:59:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbfAIW7y (ORCPT ); Wed, 9 Jan 2019 17:59:54 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3FB680F6C; Wed, 9 Jan 2019 22:59:53 +0000 (UTC) Received: from treble.redhat.com (ovpn-125-32.rdu2.redhat.com [10.10.125.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id B85A11019632; Wed, 9 Jan 2019 22:59:51 +0000 (UTC) From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , Andy Lutomirski , Steven Rostedt , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Linus Torvalds , Masami Hiramatsu , Jason Baron , Jiri Kosina , David Laight , Borislav Petkov , Julia Cartwright , Jessica Yu , "H. Peter Anvin" , Nadav Amit , Rasmus Villemoes , Edward Cree , Daniel Bristot de Oliveira Subject: [PATCH v3 1/6] compiler.h: Make __ADDRESSABLE() symbol truly unique Date: Wed, 9 Jan 2019 16:59:36 -0600 Message-Id: <8bc857824f82462a296a8a3c4913a11a7f801e74.1547073843.git.jpoimboe@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 09 Jan 2019 22:59:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The __ADDRESSABLE() macro uses the __LINE__ macro to create a temporary symbol which has a unique name. However, if the macro is used multiple times from within another macro, the line number will always be the same, resulting in duplicate symbols. Make the temporary symbols truly unique by using __UNIQUE_ID instead of __LINE__. Acked-by: Ard Biesheuvel Signed-off-by: Josh Poimboeuf --- include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index fc5004a4b07d..5e45bc988b1e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -291,7 +291,7 @@ unsigned long read_word_at_a_time(const void *addr) */ #define __ADDRESSABLE(sym) \ static void * __section(".discard.addressable") __used \ - __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; + __UNIQUE_ID(__addressable_##sym) = (void *)&sym; /** * offset_to_ptr - convert a relative memory offset to an absolute pointer -- 2.17.2