Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9713100imu; Wed, 5 Dec 2018 09:05:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/VX9ZqtruywXDztfLzWmDgyLFLnOlDWdZtDn+JjKf/r0DevOq70inqFKl1UpdkzdeJdeSM0 X-Received: by 2002:a17:902:981:: with SMTP id 1mr24199458pln.142.1544029546401; Wed, 05 Dec 2018 09:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544029546; cv=none; d=google.com; s=arc-20160816; b=GLSQ7ODqZBE11Et80OqwbJ99PVd+KtHTpv/7xiqpac1rRRsSLVc1Lg932y+o/yRJ7v aJhIKgtcMR9fKpv841xxrgAi+2PZDlbuIl0jpE+liEAxChmkRcqHiTJP4wLcrkvzC7ro YOWGw2WjJ0HRxjWVuOIV6cfbvQHtSzIS7wlv+5deRrJ7oL2/JNwKt9+ctP4B8ZeIliCL Ubh703bZNdwlQ5PP7OXmeyRnwhbkfnV7ApeGO18ktioChLjxgdKka9ABX1CtY7kzylod UDg4P+N/sY6HP1gaRU9qHPbAcK97enEvj7P61hcWNAmsdCucvcSSKONUFsoqK60IoSu5 az8w== 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 :message-id:date:subject:cc:to:from; bh=y2DCD07anShtIFh91e+Rxhk1hzs1bdcRj9Gtl4m5ffg=; b=ej4MzwQ7YZOoiyJTU2s4D4CHV2BJO4+YRAXOr4OyHPJtIxuXXrJbBscxZRAd2Fyc4u 7QS3fW4kthMytrwPQ9PhdHk4xxpyO8Vm6qiMv+6L95ALT+V30PXT8WOFC3BhhSSaHHLZ GeuCCaqNcyGmMkmbskFQAEr3NwTTiOuJ1eWAJWwUHV8Xp4Si612Ecw7aKKOt/s79lTGC kp9iBmn8dRMbmYifjHUORthnlhgSTiZIn4JZRVFtCLpkp2cVwnjBxz4NcEg+OAG8dpbM 4Xw4ng6U0pMpVgZrNyHQBp5vX6lQFmJlKIbfVHpqfSgqoNUEVapOh+TxphfVnDxStHLe YIUQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si12718549pld.249.2018.12.05.09.05.27; Wed, 05 Dec 2018 09:05:46 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbeLERCX (ORCPT + 99 others); Wed, 5 Dec 2018 12:02:23 -0500 Received: from mail.netline.ch ([148.251.143.178]:43559 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727242AbeLERCW (ORCPT ); Wed, 5 Dec 2018 12:02:22 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 246082A604C; Wed, 5 Dec 2018 17:56:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id b476zuukV2dg; Wed, 5 Dec 2018 17:56:22 +0100 (CET) Received: from kaveri (39.1.199.178.dynamic.wline.res.cust.swisscom.ch [178.199.1.39]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 892332A604B; Wed, 5 Dec 2018 17:56:22 +0100 (CET) Received: from daenzer by kaveri with local (Exim 4.91) (envelope-from ) id 1gUaTF-0001WN-UA; Wed, 05 Dec 2018 17:56:21 +0100 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= To: Christian Koenig , Huang Rui , Junwei Zhang , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled Date: Wed, 5 Dec 2018 17:56:20 +0100 Message-Id: <20181205165621.5805-1-michel@daenzer.net> X-Mailer: git-send-email 2.20.0.rc2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michel Dänzer The following cases are possible for pr_debug(): 1. CONFIG_DYNAMIC_DEBUG disabled a) DEBUG not defined: pr_debug() translates to no_printk(...), i.e. it never generates any output. b) DEBUG defined: pr_debug() translates to printk(KERN_DEBUG ...), i.e. it generates output which doesn't appear in dmesg by default, can be enabled dynamically. 2. CONFIG_DYNAMIC_DEBUG enabled: pr_debug() translates to dynamic_pr_debug() a) DEBUG not defined: dynamic_pr_debug() generates no output by default, can be enabled dynamically. b) DEBUG defined: dynamic_pr_debug() generates output by default, can be disabled dynamically. The intention for drm_debug_printer() is to generate output which doesn't appear in dmesg by default, but can be enabled dynamically, i.e. cases 1b) and 2a). However, defining DEBUG unconditionally gave us 2b) instead of 2a) with CONFIG_DYNAMIC_DEBUG enabled. Fixes: 79a5ad2fdb3c ("drm: Enable pr_debug() for drm_printer") Signed-off-by: Michel Dänzer --- drivers/gpu/drm/drm_print.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 0e7fc3e7dfb4..ee56e4a1b343 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -23,11 +23,13 @@ * Rob Clark */ -#define DEBUG /* for pr_debug() */ - #include #include #include + +#ifndef CONFIG_DYNAMIC_DEBUG +#define DEBUG /* for pr_debug() */ +#endif #include void __drm_puts_coredump(struct drm_printer *p, const char *str) -- 2.20.0.rc2