From patchwork Mon Sep 26 02:18:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9350115 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 A5D5E607F0 for ; Mon, 26 Sep 2016 02:26:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97FC628ACF for ; Mon, 26 Sep 2016 02:26:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C84728B28; Mon, 26 Sep 2016 02:26:14 +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 0B6F828ACF for ; Mon, 26 Sep 2016 02:26:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED9B06E302; Mon, 26 Sep 2016 02:26:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from smtprelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by gabe.freedesktop.org (Postfix) with ESMTPS id D574C6E302 for ; Mon, 26 Sep 2016 02:26:10 +0000 (UTC) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave05.hostedemail.com (Postfix) with ESMTP id 1439D183DC3 for ; Mon, 26 Sep 2016 02:18:42 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 91BDD6A92C; Mon, 26 Sep 2016 02:18:39 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: fifth18_2e48dc003414e X-Filterd-Recvd-Size: 6212 Received: from joe-laptop.perches.com (unknown [96.251.125.34]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Mon, 26 Sep 2016 02:18:37 +0000 (UTC) From: Joe Perches To: Daniel Vetter , Jani Nikula , David Airlie Date: Sun, 25 Sep 2016 19:18:33 -0700 Message-Id: <3187035019207d96dd8b290bbcce203a38e7d1d3.1474856262.git.joe@perches.com> X-Mailer: git-send-email 2.10.0.rc2.1.g053435c In-Reply-To: References: Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 1/2] drm: Simplify logging macros, convert DRM_NOTE to DRM_NOTICE 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 Use a bit more consistent style with kernel loglevels without using macro argument concatenation. Miscellanea: o Single statement macros don't need do {} while (0) Signed-off-by: Joe Perches --- drivers/gpu/drm/i915/intel_guc_loader.c | 22 ++++++++++++---------- include/drm/drmP.h | 26 +++++++++++++------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c index 6fd39efb7894..bc4f9895f356 100644 --- a/drivers/gpu/drm/i915/intel_guc_loader.c +++ b/drivers/gpu/drm/i915/intel_guc_loader.c @@ -566,7 +566,7 @@ int intel_guc_setup(struct drm_device *dev) else if (err == 0) DRM_INFO("GuC firmware load skipped\n"); else if (ret != -EIO) - DRM_NOTE("GuC firmware load failed: %d\n", err); + DRM_NOTICE("GuC firmware load failed: %d\n", err); else DRM_WARN("GuC firmware load failed: %d\n", err); @@ -574,7 +574,7 @@ int intel_guc_setup(struct drm_device *dev) if (fw_path == NULL) DRM_INFO("GuC submission without firmware not supported\n"); if (ret == 0) - DRM_NOTE("Falling back from GuC submission to execlist mode\n"); + DRM_NOTICE("Falling back from GuC submission to execlist mode\n"); else DRM_ERROR("GuC init failed: %d\n", ret); } @@ -606,7 +606,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw) /* Check the size of the blob before examining buffer contents */ if (fw->size < sizeof(struct guc_css_header)) { - DRM_NOTE("Firmware header is missing\n"); + DRM_NOTICE("Firmware header is missing\n"); goto fail; } @@ -618,7 +618,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw) css->key_size_dw - css->exponent_size_dw) * sizeof(u32); if (guc_fw->header_size != sizeof(struct guc_css_header)) { - DRM_NOTE("CSS header definition mismatch\n"); + DRM_NOTICE("CSS header definition mismatch\n"); goto fail; } @@ -628,7 +628,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw) /* now RSA */ if (css->key_size_dw != UOS_RSA_SCRATCH_MAX_COUNT) { - DRM_NOTE("RSA key size is bad\n"); + DRM_NOTICE("RSA key size is bad\n"); goto fail; } guc_fw->rsa_offset = guc_fw->ucode_offset + guc_fw->ucode_size; @@ -637,14 +637,14 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw) /* At least, it should have header, uCode and RSA. Size of all three. */ size = guc_fw->header_size + guc_fw->ucode_size + guc_fw->rsa_size; if (fw->size < size) { - DRM_NOTE("Missing firmware components\n"); + DRM_NOTICE("Missing firmware components\n"); goto fail; } /* Header and uCode will be loaded to WOPCM. Size of the two. */ size = guc_fw->header_size + guc_fw->ucode_size; if (size > guc_wopcm_size(to_i915(dev))) { - DRM_NOTE("Firmware is too large to fit in WOPCM\n"); + DRM_NOTICE("Firmware is too large to fit in WOPCM\n"); goto fail; } @@ -659,9 +659,11 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw) if (guc_fw->guc_fw_major_found != guc_fw->guc_fw_major_wanted || guc_fw->guc_fw_minor_found < guc_fw->guc_fw_minor_wanted) { - DRM_NOTE("GuC firmware version %d.%d, required %d.%d\n", - guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found, - guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted); + DRM_NOTICE("GuC firmware version %d.%d, required %d.%d\n", + guc_fw->guc_fw_major_found, + guc_fw->guc_fw_minor_found, + guc_fw->guc_fw_major_wanted, + guc_fw->guc_fw_minor_wanted); err = -ENOEXEC; goto fail; } diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c53dc90942e0..95cd04aa9bf7 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -168,25 +168,25 @@ 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_printk(level, fmt, ...) \ + printk(level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) #define DRM_INFO(fmt, ...) \ - _DRM_PRINTK(, INFO, fmt, ##__VA_ARGS__) -#define DRM_NOTE(fmt, ...) \ - _DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__) + _drm_printk(KERN_INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTICE(fmt, ...) \ + _drm_printk(KERN_NOTICE, fmt, ##__VA_ARGS__) #define DRM_WARN(fmt, ...) \ - _DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__) + _drm_printk(KERN_WARNING, fmt, ##__VA_ARGS__) + +#define _drm_printk_once(level, fmt, ...) \ + printk_once(level "[" DRM_NAME "] " fmt, ##__VA_ARGS__) #define DRM_INFO_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, INFO, fmt, ##__VA_ARGS__) -#define DRM_NOTE_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__) + _drm_printk_once(KERN_INFO, fmt, ##__VA_ARGS__) +#define DRM_NOTICE_ONCE(fmt, ...) \ + _drm_printk_once(KERN_NOTICE, fmt, ##__VA_ARGS__) #define DRM_WARN_ONCE(fmt, ...) \ - _DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__) + _drm_printk_once(KERN_WARNING, fmt, ##__VA_ARGS__) /** * Error output.