Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4243643yba; Tue, 9 Apr 2019 14:27:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAnu1KwgAMjmIax0uTjshREWLeff1ufHyLR5W7Vhf1/aEn48qoMn/sy9/7E5tczXwC555V X-Received: by 2002:a62:1249:: with SMTP id a70mr39005620pfj.160.1554845233242; Tue, 09 Apr 2019 14:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554845233; cv=none; d=google.com; s=arc-20160816; b=Wxd+IikgEZs7Sw9seNWV44QiNrf1ez3T0OLeQfASOADRZCj3mUvfjhBj2SYcYiey1w WUQpeWGmWUvTh+quWw3A7D40R/Y3rfeT/FCbp+zrLb6N/FNloGlNhG162/PFIgbQDMja YEg+ZG2jjiaW6Cv1w3FMxKNAAEX7dw93ZNbdNwn9HSdpqCdOp0GJtfwX3h3OgW+0MZVP mVMsEyAlSSawF6zledp5hgltQ8FcJO+1fYsWacZnLEKegAgGUyR4vloH2mQZlNx2OEZt 4WMCmeF78C1II0sUTLR9o5NlBaz4sxY68K5kUM6FIlaHoRXAybipqwy7DZDp89U83qkb DBUw== 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=egu/ShKNB6lPlRGpHkDqNDnUlrXghqZM5FQYZ1eQ3vo=; b=mfs2sUse0aGbPeQI12dYwyFAqNhwuAjrgbcwHqsRkSLnxxdanyQpV1WYTvU48oHfAs /YCEO7d+auml5/ri2Dryq/t0jSzdckZc1iYDEfvSQZNtNslFg2EaUpvziiYrkxFWxhAz eOit3Z8s9OC/axupRDDbBrQ7xvJdeCzdjWNMpmTI2l/zplGg1Oz9Md/7LZNcuIum++4U POrvqyKhxJRWBsnxVnEccIFkQHfo/PLMlXA85zvvVfQRaRaCCYo+HBi6q+a2vOWrhkU7 BO/LOhZrgBCsdPYQQopjWbi38RRhq4cCfDqwJsjeBwfecKvKXk3tPqz+/f2WLEqzC51K f9+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=dLrB8M3y; 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 l4si18572926pgp.280.2019.04.09.14.26.57; Tue, 09 Apr 2019 14:27:13 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=dLrB8M3y; 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 S1726797AbfDIV0C (ORCPT + 99 others); Tue, 9 Apr 2019 17:26:02 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37147 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbfDIVZz (ORCPT ); Tue, 9 Apr 2019 17:25:55 -0400 Received: by mail-ed1-f67.google.com with SMTP id l20so135749edv.4 for ; Tue, 09 Apr 2019 14:25:54 -0700 (PDT) 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=egu/ShKNB6lPlRGpHkDqNDnUlrXghqZM5FQYZ1eQ3vo=; b=dLrB8M3ypxu3nnmBeKkwwj+n6jmQPQGAU8J82Q4SzFmJPCnpcNXG8P7bXfB7+UJ+fA KppAylZAFQHhEJU/k+sjdHEqoiU4A7i4s3Z9JK9LCGU127fw+RTnWvXH1I4Oqt1P7x+9 9FQA3fXo2niLP+nDPJAEDpfBuknYxLHLn++I4= 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=egu/ShKNB6lPlRGpHkDqNDnUlrXghqZM5FQYZ1eQ3vo=; b=JN92XXcNHWrQGzuJv5qFe+ioIraWgHXyadWmuc5sAsobZj7OYRRpSkAZa7HmP3VzrH AOxtWW/w3ArqhXaFHxC/QIfIXWl8ZI07T64MOEtBNAyokP95KKjpXVurI9BduFKDgqpF atzdcaApwENIGsX/v+PQtpg8j7paWWuOi7bWvlhsElAAcbyoTcsyvk/Y1sxf7hUgrd6+ u/Xhys79FqE6XabeCSWfM9DpiXmmNc05RPjJzmjpqncOurNButj2NJMmgWw202cuQ7Hy mnDezf0Wo0FkeTNGCC0xTGPdtIWRsN9VVtxrxLcQkASBy0UhsaCuOeadAYYu2tPLshte Ze7w== X-Gm-Message-State: APjAAAX9ODqZQTS7OkTej+nk7p2OPHcr4P9zZT2aDyZVcnzp/bWOc3O0 ekBJ9EwEtPlxdsgQAVkukN3/Ug== X-Received: by 2002:a17:906:19db:: with SMTP id h27mr3401615ejd.4.1554845154084; Tue, 09 Apr 2019 14:25:54 -0700 (PDT) Received: from prevas-ravi.prevas.se (ip-5-186-118-63.cgn.fibianet.dk. [5.186.118.63]) by smtp.gmail.com with ESMTPSA id i26sm3477986ejc.51.2019.04.09.14.25.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Apr 2019 14:25:53 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton Cc: Jason Baron , linux-kernel@vger.kernel.org, Rasmus Villemoes , Petr Mladek , Steven Rostedt Subject: [PATCH 03/10] linux/printk.h: use unique identifier for each struct _ddebug Date: Tue, 9 Apr 2019 23:25:10 +0200 Message-Id: <20190409212517.7321-4-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190409212517.7321-1-linux@rasmusvillemoes.dk> References: <20190409212517.7321-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 d7c77ed1a4cb..0fcc588db649 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -454,7 +454,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, \ @@ -464,6 +464,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.20.1