From patchwork Thu Sep 1 12:48:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 9309015 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 5504160756 for ; Thu, 1 Sep 2016 12:49:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FFC529382 for ; Thu, 1 Sep 2016 12:49:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4509F29387; Thu, 1 Sep 2016 12:49:02 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 1534629382 for ; Thu, 1 Sep 2016 12:49:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 749B36E93D; Thu, 1 Sep 2016 12:49:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id A900B6E93B for ; Thu, 1 Sep 2016 12:48:58 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id w207so8276956wmw.0 for ; Thu, 01 Sep 2016 05:48:58 -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 :mime-version:content-transfer-encoding; bh=KwbyJ0STb+VjHxGzgfDQN4JvqTYH2Co3ibcRpY+v5JM=; b=Va/+mhLgWNrx5cAu6YcP/qUXonPVTYVh/PZ6t4bjSEhhcCZ1aTHlXnZ8MonX/a54tA wG4ZdS8iQyUZ74+LQqLDH/EWhkFoM/DTRlHieByJNWtC0+v0kswP7GTymldRcCKcwKqf zDeWpBTyye471Ak/OXIiOgP6Nzpa5ARhvsAS5piEioqQFGGMES+VONx9+E8132DPCACd oBshad4nYZ3SKtzQ+XN9c9wrwnH+52Kq9YH67r6riAR2Qz9mpXEw8f9JoUQre5yPW1Sh yHS0cbdcBmX8+H/ZqIr/jm8UKtPVG/HLVm8qYV4dzeoGioUVsjeN7s8F4XQF6rsIdz1m 1Suw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KwbyJ0STb+VjHxGzgfDQN4JvqTYH2Co3ibcRpY+v5JM=; b=DS6H2C/Hu0xcGv2sWtdA6iXq8PFpWjXQb2z7mZz0u5AvL0pisbNdbfBt+8diXqtqN+ HUsOu+trzZFKzNPoC1kwOCGHAf3CsHUa7kJiWS0zstVWD0Nj3ypb4Yjbt9Eqe2okwTp2 V7+dl3pbSRsWEhqOXFL2yYTJuKh29Zu5tBOyT0niwXZ4VtqdRVOyP1jXhfeER2F/qF2F MOeZOC9kmxFgGmJBeji+9IC5s3tC1/86UNoJL5X2R+cGMqfzL+b0bzyhBuUabkBg6qID uQX3U+2DcSmVMEJucivlPccO05v+XzsBMPBA+MkJoj3cnzGCU5tcRvJrCz4uaeJRQ/8Q C20g== X-Gm-Message-State: AE9vXwMHCVxC267LbaUxXOWc2rWGqv08s2n+CaPQ2DF8PZxXePxrpOHbbc0NPMW6mKjeaQ== X-Received: by 10.194.176.69 with SMTP id cg5mr13629979wjc.52.1472734137158; Thu, 01 Sep 2016 05:48:57 -0700 (PDT) Received: from localhost.localdomain ([37.120.86.93]) by smtp.gmail.com with ESMTPSA id i8sm14287786wmg.21.2016.09.01.05.48.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 05:48:55 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/6] drm: drop obsolete drm_core.h Date: Thu, 1 Sep 2016 14:48:36 +0200 Message-Id: <20160901124837.680-6-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160901124837.680-1-dh.herrmann@gmail.com> References: <20160901124837.680-1-dh.herrmann@gmail.com> MIME-Version: 1.0 Cc: Daniel Vetter 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The drm_core.h header contains a set of constants meant to be used throughout DRM. However, as it turns out, they're each used just once and don't bring any benefit. They're also grossly mis-named and lack name-spacing. This patch inlines them, or moves them into drm_internal.h as appropriate: - CORE_AUTHOR and CORE_DESC are inlined into corresponding MODULE_*() macros. It's just confusing having to follow 2 pointers when trying to find the definition of these fields. Grep'ping for MODULE_AUTHOR() should reveal the full information, if there's no strong reason not to. - CORE_NAME, CORE_DATE, CORE_MAJOR, CORE_MINOR, and CORE_PATCHLEVEL are inlined into the sysfs 'version' attribute. They're stripped everywhere else (which is just some printk() statements). CORE_NAME just doesn't make *any* sense, as we hard-code it in many places, anyway. The other constants are outdated and just serve binary-compatibility purposes. Hence, inline them in 'version' sysfs attribute (we might even try dropping it..). - DRM_IF_MAJOR and DRM_IF_MINOR are moved into drm_internal.h as they're only used by the global ioctl handlers. Furthermore, versioning interfaces breaks backports and as such is deprecated, anyway. We just keep them for historic reasons. I doubt anyone will ever modify them again. Signed-off-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 8 +++----- drivers/gpu/drm/drm_internal.h | 3 +++ drivers/gpu/drm/drm_ioc32.c | 1 - drivers/gpu/drm/drm_ioctl.c | 1 - drivers/gpu/drm/drm_sysfs.c | 8 +------- include/drm/drm_core.h | 34 ---------------------------------- 6 files changed, 7 insertions(+), 48 deletions(-) delete mode 100644 include/drm/drm_core.h diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 9ab0016..d771453 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "drm_crtc_internal.h" #include "drm_legacy.h" #include "drm_internal.h" @@ -46,8 +45,8 @@ unsigned int drm_debug = 0; EXPORT_SYMBOL(drm_debug); -MODULE_AUTHOR(CORE_AUTHOR); -MODULE_DESCRIPTION(CORE_DESC); +MODULE_AUTHOR("Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl"); +MODULE_DESCRIPTION("DRM shared core routines"); MODULE_LICENSE("GPL and additional rights"); MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n" "\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n" @@ -966,8 +965,7 @@ static int __init drm_core_init(void) goto err_p3; } - DRM_INFO("Initialized %s %d.%d.%d %s\n", - CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); + DRM_INFO("Initialized\n"); return 0; err_p3: drm_sysfs_destroy(); diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index 9b66cc4..3d6a587 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h @@ -21,6 +21,9 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#define DRM_IF_MAJOR 1 +#define DRM_IF_MINOR 4 + /* drm_irq.c */ extern unsigned int drm_timestamp_monotonic; diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 57676f8..2795d6a 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -32,7 +32,6 @@ #include #include -#include #define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t) #define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index bc5c65e..845390f 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -29,7 +29,6 @@ */ #include -#include #include #include "drm_legacy.h" #include "drm_internal.h" diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 32dd821..9a37196 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -19,7 +19,6 @@ #include #include -#include #include #include "drm_internal.h" @@ -37,12 +36,7 @@ static char *drm_devnode(struct device *dev, umode_t *mode) return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); } -static CLASS_ATTR_STRING(version, S_IRUGO, - CORE_NAME " " - __stringify(CORE_MAJOR) "." - __stringify(CORE_MINOR) "." - __stringify(CORE_PATCHLEVEL) " " - CORE_DATE); +static CLASS_ATTR_STRING(version, S_IRUGO, "drm 1.1.0 20060810"); /** * drm_sysfs_init - initialize sysfs helpers diff --git a/include/drm/drm_core.h b/include/drm/drm_core.h deleted file mode 100644 index 4e75238..0000000 --- a/include/drm/drm_core.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2004 Jon Smirl - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ -#define CORE_AUTHOR "Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl" - -#define CORE_NAME "drm" -#define CORE_DESC "DRM shared core routines" -#define CORE_DATE "20060810" - -#define DRM_IF_MAJOR 1 -#define DRM_IF_MINOR 4 - -#define CORE_MAJOR 1 -#define CORE_MINOR 1 -#define CORE_PATCHLEVEL 0