From patchwork Wed Apr 8 16:52:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6181521 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D0949F691 for ; Wed, 8 Apr 2015 16:49:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B702B20373 for ; Wed, 8 Apr 2015 16:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C17062037A for ; Wed, 8 Apr 2015 16:49:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28F3B6E127; Wed, 8 Apr 2015 09:49:25 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 545036E127 for ; Wed, 8 Apr 2015 09:49:23 -0700 (PDT) Received: by wizk4 with SMTP id k4so62305093wiz.1 for ; Wed, 08 Apr 2015 09:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XniFnNcMyBM5h07X39VBm0nrYJUbVravr52w/T3ljok=; b=DQZn9Ol6KuYZR56v13jBXxmQjt5XFMoxXCzasAoV4CTfl/uJ6HUvlA/Wzyag89QArs lPCzTjGxCYhOXOIlm5EE3w7bd+3aukcUEnaAEImADAA2hwVks8tWvTPKB9dnVCbkFe4C 98T90yBpC7Sep+1ek+rGr8kcVM0nck52vtuAJ5FFl91E/jxMXMvBGl2uXG8OlAF6M97A jx4rwzZWRKRRHG3dP2ZtuvbHOpJjWqac8gk14k1wluuvOBAJx+dWMKdP2rT6ry2RaFnd YwNIUcdwlJ5VyOCm4FZ41azaJlv7oQEfGTwLoNQIgLf+0TosBeKHd0lLF/mP0o4QnEnx sNGg== X-Received: by 10.180.8.98 with SMTP id q2mr15520933wia.80.1428511762364; Wed, 08 Apr 2015 09:49:22 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by mx.google.com with ESMTPSA id at4sm16383076wjc.16.2015.04.08.09.49.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Apr 2015 09:49:21 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__ Date: Wed, 8 Apr 2015 17:52:38 +0100 Message-Id: <1428511959-25990-2-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1428511959-25990-1-git-send-email-emil.l.velikov@gmail.com> References: <1428511959-25990-1-git-send-email-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Emil Velikov --- intel/intel_bufmgr_fake.c | 19 +++++++------------ tests/drmstat.c | 7 +------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c index 54a3983..75387b7 100644 --- a/intel/intel_bufmgr_fake.c +++ b/intel/intel_bufmgr_fake.c @@ -52,11 +52,6 @@ #include "libdrm_macros.h" #include "libdrm_lists.h" -/* Support gcc's __FUNCTION__ for people using other compilers */ -#if !defined(__GNUC__) && !defined(__FUNCTION__) -# define __FUNCTION__ __func__ /* C99 */ -#endif - #define DBG(...) do { \ if (bufmgr_fake->bufmgr.debug) \ drmMsg(__VA_ARGS__); \ @@ -278,7 +273,7 @@ _fence_emit_internal(drm_intel_bufmgr_fake *bufmgr_fake) ret = drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_IRQ_EMIT, &ie, sizeof(ie)); if (ret) { - drmMsg("%s: drm_i915_irq_emit: %d\n", __FUNCTION__, ret); + drmMsg("%s: drm_i915_irq_emit: %d\n", __func__, ret); abort(); } @@ -545,7 +540,7 @@ evict_lru(drm_intel_bufmgr_fake *bufmgr_fake, unsigned int max_fence) { struct block *block, *tmp; - DBG("%s\n", __FUNCTION__); + DBG("%s\n", __func__); DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->lru) { drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *) block->bo; @@ -572,7 +567,7 @@ evict_mru(drm_intel_bufmgr_fake *bufmgr_fake) { struct block *block, *tmp; - DBG("%s\n", __FUNCTION__); + DBG("%s\n", __func__); DRMLISTFOREACHSAFEREVERSE(block, tmp, &bufmgr_fake->lru) { drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *) block->bo; @@ -632,7 +627,7 @@ clear_fenced(drm_intel_bufmgr_fake *bufmgr_fake, unsigned int fence_cookie) } } - DBG("%s: %d\n", __FUNCTION__, ret); + DBG("%s: %d\n", __func__, ret); return ret; } @@ -717,7 +712,7 @@ evict_and_alloc_block(drm_intel_bo *bo) if (alloc_block(bo)) return 1; - DBG("%s 0x%lx bytes failed\n", __FUNCTION__, bo->size); + DBG("%s 0x%lx bytes failed\n", __func__, bo->size); return 0; } @@ -1027,12 +1022,12 @@ static int bo_fake->name, bo_fake->bo.size / 1024); if (bo->virtual != NULL) { - drmMsg("%s: already mapped\n", __FUNCTION__); + drmMsg("%s: already mapped\n", __func__); abort(); } else if (bo_fake->flags & (BM_NO_BACKING_STORE | BM_PINNED)) { if (!bo_fake->block && !evict_and_alloc_block(bo)) { - DBG("%s: alloc failed\n", __FUNCTION__); + DBG("%s: alloc failed\n", __func__); bufmgr_fake->fail = 1; return 1; } else { diff --git a/tests/drmstat.c b/tests/drmstat.c index c800ebb..023aa06 100644 --- a/tests/drmstat.c +++ b/tests/drmstat.c @@ -48,11 +48,6 @@ #endif #include "xf86drm.h" -/* Support gcc's __FUNCTION__ for people using other compilers */ -#if !defined(__GNUC__) && !defined(__FUNCTION__) -# define __FUNCTION__ __func__ /* C99 */ -#endif - int sigio_fd; static double usec(struct timeval *end, struct timeval *start) @@ -87,7 +82,7 @@ static void process_sigio(char *device) int fd; if ((fd = open(device, 0)) < 0) { - drmError(-errno, __FUNCTION__); + drmError(-errno, __func__); exit(1); }