From patchwork Fri Aug 26 17:50:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Gordon X-Patchwork-Id: 9301845 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 EEA44607EE for ; Fri, 26 Aug 2016 17:51:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E622A29414 for ; Fri, 26 Aug 2016 17:51:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAE742962D; Fri, 26 Aug 2016 17:51:11 +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=unavailable 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 A835929414 for ; Fri, 26 Aug 2016 17:51:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1573C6EB55; Fri, 26 Aug 2016 17:51:10 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 413656EB4F; Fri, 26 Aug 2016 17:51:08 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 26 Aug 2016 10:51:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,581,1464678000"; d="scan'208"; a="1031765744" Received: from dsgordon-linux2.isw.intel.com ([10.102.226.88]) by fmsmga001.fm.intel.com with ESMTP; 26 Aug 2016 10:51:07 -0700 From: Dave Gordon To: intel-gfx@lists.freedesktop.org Date: Fri, 26 Aug 2016 18:50:56 +0100 Message-Id: <1472233859-31837-2-git-send-email-david.s.gordon@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472233859-31837-1-git-send-email-david.s.gordon@intel.com> References: <1472233859-31837-1-git-send-email-david.s.gordon@intel.com> Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Cc: Eric Engestrom , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v5 1/4] drm: two more (drm_)printk() wrapper macros 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 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) v5: Much simplified after underlying functions were reworked. Signed-off-by: Dave Gordon Previously-Reviewed-by: Eric Engestrom (v2) Cc: Eric Engestrom Cc: dri-devel@lists.freedesktop.org Reviewed-by: Chris Wilson --- include/drm/drmP.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 94eb138..cd52624 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -168,6 +168,13 @@ void drm_printk(const char *level, unsigned int category, /** \name Macros to make printk easier */ /*@{*/ +#define DRM_INFO(fmt, ...) \ + drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) +#define DRM_NOTE(fmt, ...) \ + drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) +#define DRM_WARN(fmt, ...) \ + drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__) + /** * Error output. * @@ -202,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, ...) \ ({ \