From patchwork Wed Sep 7 17:36:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gordon X-Patchwork-Id: 9319721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C214F60752 for ; Wed, 7 Sep 2016 17:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A52F1292E0 for ; Wed, 7 Sep 2016 17:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99AD7293F5; Wed, 7 Sep 2016 17:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED85F292E0 for ; Wed, 7 Sep 2016 17:36:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31C556E277; Wed, 7 Sep 2016 17:36:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DC496E277 for ; Wed, 7 Sep 2016 17:36:28 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 07 Sep 2016 10:36:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,296,1470726000"; d="scan'208";a="5567604" Received: from dsgordon-linux2.isw.intel.com ([10.102.226.88]) by fmsmga005.fm.intel.com with ESMTP; 07 Sep 2016 10:36:25 -0700 From: Dave Gordon To: intel-gfx@lists.freedesktop.org Date: Wed, 7 Sep 2016 18:36:18 +0100 Message-Id: <1473269778-11749-1-git-send-email-david.s.gordon@intel.com> X-Mailer: git-send-email 1.9.1 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH v6] drm: two more (drm_)printk() wrapper macros (fixup) X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Between v2 and v3 of this patch, c4e68a583202 ("drm: Introduce DRM_DEV_* log messages") was introduced upstream, and this was the reason for the rewrite as v3. Unfortunately a maintainer pushed the earlier version to drm-intel-next 30b0da8d556e ("drm: extra printk() wrapper macros") creating a conflict with upstream. This patch is equivalent to reverting v2 and then correctly applying v3. AFAICT, it could be squashed into 30b0da8d556e ("drm: extra printk() wrapper macros") or can be left as a subsequent correction. Original commentary: We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk() provides several other useful intermediate levels such as NOTICE and WARNING. So this patch fills out the set by providing simple macros for the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED versions yet as it seems unlikely that they'll be as useful. v2: Fix whitespace, missing ## (Eric Engestrom) v3: Much simplified after underlying functions were reworked. v6: Fixup, effectively revert v2 and apply v3 Signed-off-by: Dave Gordon Reviewed-by: Eric Engestrom (v2, v3) Reviewed-by: Chris Wilson (v3) Cc: Tvrtko Ursulin --- include/drm/drmP.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index f62f6e3..cd52624 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -168,21 +168,12 @@ void drm_printk(const char *level, unsigned int category, /** \name Macros to make printk easier */ /*@{*/ -#define _DRM_PRINTK(once, level, fmt, ...) \ - do { \ - printk##once(KERN_##level "[" DRM_NAME "] " fmt, \ - ##__VA_ARGS__); \ - } while (0) - +#define DRM_INFO(fmt, ...) \ + drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) #define DRM_NOTE(fmt, ...) \ - _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) + drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) #define DRM_WARN(fmt, ...) \ - _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) - -#define DRM_NOTE_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) -#define DRM_WARN_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) /** * Error output. @@ -218,8 +209,6 @@ void drm_printk(const char *level, unsigned int category, #define DRM_DEV_INFO(dev, fmt, ...) \ drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt, \ ##__VA_ARGS__) -#define DRM_INFO(fmt, ...) \ - drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) #define DRM_DEV_INFO_ONCE(dev, fmt, ...) \ ({ \