Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1352723imu; Fri, 9 Nov 2018 15:15:09 -0800 (PST) X-Google-Smtp-Source: AJdET5dVxt0TSpaOzScYHwSl1kvc9/Q7BcmbaFmpe+CEE9MbhHmgAwB/mP4dZyaHXcjC+9wnSL6d X-Received: by 2002:a63:cd17:: with SMTP id i23mr9128105pgg.13.1541805309926; Fri, 09 Nov 2018 15:15:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541805309; cv=none; d=google.com; s=arc-20160816; b=jqMyvkjWMCNENeLJIVamCKAYrggDA+c+eXROK+oWYvDcTHeks9C5ry+fiRxiaT/6qS k/F2jKbqeHpMpQxXV+RFbrDnoqWrizdgBqiXd+rt0yd1A+ESd5A8RR6Y0CtEJKwoere6 ZPw/HfMPytAHcrRE+VQG8n9xmcelZEkAAJ1xWqdZD1rsKaLgF38d/ERjMiVwNii9P8/D FFnCCnfzyotMb4gbnxzIkOyw4pE74LnPDs6JQLzu3Y6jFa5SjVY3OHV6pyFjenF5mXNn 3O/sCGRqsw/MX/FOlf8FkcL3YGuooxGh+F/B2BUhipk141Wz6YldwMGbjOUyoKsSGy/h cgDQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rx+ebopWynv2pOfqIg4NyYDXklKL/npA0QpqYu+ZvK8=; b=ePuAxZE5FYi7OayT6MZnNfLMcGm6yE2L7UdWOfFJXPU+O8geOvjpJ4xX30KmPETq2y qBuSDYR8okUAeFGRZmcQoojBRMOoOr14pwv/1fhYeDW8JceCP2yoKRjD1xpc641BQH2A YUYJHmY9H+SJ7HgGs2i/mL/PBIIDQ8iJASTSqzu/YMhkramNRWdwuXvCa0PXFe0YmK7x V1+HT1HEpEl6Wicmddzz4hQrLIF6SMyPlPFb8jN1bSkLEaiaTUx4Vdj58SowCDmEzyyS yqflxT/8abX7yIg7HXw874c+oQrKMkpmF2XszyO2LSGiH9U8BaYB49LMIWQytLot0mvb eOcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="h7nbQGX/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si7807916pgb.43.2018.11.09.15.14.54; Fri, 09 Nov 2018 15:15:09 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="h7nbQGX/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728785AbeKJIxy (ORCPT + 99 others); Sat, 10 Nov 2018 03:53:54 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:41751 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728655AbeKJIxx (ORCPT ); Sat, 10 Nov 2018 03:53:53 -0500 Received: by mail-lj1-f193.google.com with SMTP id z80-v6so2964378ljb.8 for ; Fri, 09 Nov 2018 15:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Rx+ebopWynv2pOfqIg4NyYDXklKL/npA0QpqYu+ZvK8=; b=h7nbQGX/iESnaLlS4Yj7XjQd0DVgwozk6AXiHFyC3wYstW5ijoV2BhZ2Sily9gHS6l tKMj2ZUwIQQdhqK4YlvJuoEx8cjOcC+0wCqGy+KXmVtBuzUnyKvjTH0LBVvwzTG/rpRc ZNFha+DZiGJ6Li33YIlpTU9gkav6JZ9jNYYxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Rx+ebopWynv2pOfqIg4NyYDXklKL/npA0QpqYu+ZvK8=; b=dUeT3esO987h9PYZlmspKQ8lfcs5mygezxWcTMSxJbaQNaCxjz4K3K7Fks2kTC+JrQ U3HexmUy8EjwFPdi55t/yVhtIhIKM/4NGcVIBRGSv14oY2aFpLhtwsRj5dZClXvYvqjU pl/ypAH7SPmMn5iUZyrlvoG/ZwZWUypwwSi0znGrsgQpzTbWlAs2YmhL17/MoObouV5u kuVVinaGw5NANlhO/hd+AKRMmG/lyvyVq72SBxo3P/Ldo+wOpYyatqUAGo8RmtVuG49o AfcAIhm/NFULedpuFhwz0DAF9hTX/+xDR7rA+7P/hefiYxTQF4BWvYj/bs5UdsJlEu9g ItAg== X-Gm-Message-State: AGRZ1gJHvQCBlhM/oMV9igY1tfKtrFy7VDppmO3TVsiYzDy0KRHfZMAl srccrGc/eETAHooTDERnLm9gHT/cI5wg0A== X-Received: by 2002:a2e:9b15:: with SMTP id u21-v6mr6686968lji.29.1541805067090; Fri, 09 Nov 2018 15:11:07 -0800 (PST) Received: from prevas-ravi.prevas.se (dhcp-5-186-114-252.cgn.ip.fibianet.dk. [5.186.114.252]) by smtp.gmail.com with ESMTPSA id x16sm1584012lff.26.2018.11.09.15.11.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Nov 2018 15:11:06 -0800 (PST) From: Rasmus Villemoes To: Andrew Morton , Jason Baron Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Petr Mladek , Steven Rostedt Subject: [PATCH v3 06/23] linux/printk.h: use unique identifier for each struct _ddebug Date: Sat, 10 Nov 2018 00:10:04 +0100 Message-Id: <20181109231021.11658-7-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.6.gbde171bbf5 In-Reply-To: <20181109231021.11658-1-linux@rasmusvillemoes.dk> References: <20181009112013.14238-1-linux@rasmusvillemoes.dk> <20181109231021.11658-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes on x86-64 later in this series require that all struct _ddebug descriptors in a translation unit uses distinct identifiers. Realize that for pr_debug_ratelimited by generating such an identifier via __UNIQUE_ID and pass that to an extra level of macros. No functional change. Acked-by: Petr Mladek Acked-by: Jason Baron Cc: Steven Rostedt Signed-off-by: Rasmus Villemoes --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index d3ba3245531d..70df2c578d40 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -460,7 +460,7 @@ extern int kptr_restrict; /* If you are writing a driver, please use dev_dbg instead */ #if defined(CONFIG_DYNAMIC_DEBUG) /* descriptor check is first to prevent flooding with "callbacks suppressed" */ -#define pr_debug_ratelimited(fmt, ...) \ +#define _pr_debug_ratelimited(descriptor, fmt, ...) \ do { \ static DEFINE_RATELIMIT_STATE(_rs, \ DEFAULT_RATELIMIT_INTERVAL, \ @@ -470,6 +470,8 @@ do { \ __ratelimit(&_rs)) \ __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ } while (0) +#define pr_debug_ratelimited(fmt, ...) \ + _pr_debug_ratelimited(__UNIQUE_ID(ddebug), fmt, ##__VA_ARGS__) #elif defined(DEBUG) #define pr_debug_ratelimited(fmt, ...) \ printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) -- 2.19.1.6.gbde171bbf5