From patchwork Mon Aug 24 16:34:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 7065591 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EE53DC05AC for ; Mon, 24 Aug 2015 16:30:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 304BD20786 for ; Mon, 24 Aug 2015 16:30:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 35A4520787 for ; Mon, 24 Aug 2015 16:30:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 032F96EA04; Mon, 24 Aug 2015 09:30:21 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E13A6E9F4 for ; Mon, 24 Aug 2015 09:30:14 -0700 (PDT) Received: by widdq5 with SMTP id dq5so55577934wid.1 for ; Mon, 24 Aug 2015 09:30:13 -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=pwfN+DLuOkG0B3vUpZTgCdVtVetOx/U+MoZtj4OdSrI=; b=ZSFLdgZn1rhc7+dhmoJ+lLzRIJobwvmLD/Lg498mlJryOxas06F9OxXLx/n+yeKJDk sWxgNltMSMR1+PWlVII1BKMUH7Czo44E+iarF/DRdo09Po7fYQ3viXt5aBOWEokdNqEq 7vPn+2swtdVoIALHlmpwhCJa1kipFPjIs/iRtuBOFl3uPMzHPxqDQumcvciG3RCS2z9M poOhYQGV1s/DujlcfpVny6WaOjMGgQ0ecX8dWwwYCKKZSHgOWotmeqO/Q8cCwG+/waNR p0aexLUWMlQCSa4e1sjs2nd+FQvQ0pdMRIVpWIRpUTqmTh4/5lInM4Qurxk3iiXoQVij OaCQ== X-Received: by 10.194.57.166 with SMTP id j6mr40760728wjq.29.1440433812993; Mon, 24 Aug 2015 09:30:12 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by smtp.gmail.com with ESMTPSA id ll1sm16885984wic.14.2015.08.24.09.30.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Aug 2015 09:30:12 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 09/17] radeon: cleanup bo/cs func tables Date: Mon, 24 Aug 2015 17:34:12 +0100 Message-Id: <1440434060-31347-9-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440434060-31347-1-git-send-email-emil.l.velikov@gmail.com> References: <1440434060-31347-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=-5.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Annotate the data as static const and use C99 designated initializers. Signed-off-by: Emil Velikov Reviewed-by: Alex Deucher --- radeon/radeon_bo_gem.c | 23 ++++++++++++----------- radeon/radeon_bo_int.h | 2 +- radeon/radeon_cs_gem.c | 20 ++++++++++---------- radeon/radeon_cs_int.h | 2 +- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c index 7fdd437..c9fe19f 100644 --- a/radeon/radeon_bo_gem.c +++ b/radeon/radeon_bo_gem.c @@ -270,17 +270,18 @@ static int bo_get_tiling(struct radeon_bo_int *boi, uint32_t *tiling_flags, return r; } -static struct radeon_bo_funcs bo_gem_funcs = { - bo_open, - bo_ref, - bo_unref, - bo_map, - bo_unmap, - bo_wait, - NULL, - bo_set_tiling, - bo_get_tiling, - bo_is_busy, +static const struct radeon_bo_funcs bo_gem_funcs = { + .bo_open = bo_open, + .bo_ref = bo_ref, + .bo_unref = bo_unref, + .bo_map = bo_map, + .bo_unmap = bo_unmap, + .bo_wait = bo_wait, + .bo_is_static = NULL, + .bo_set_tiling = bo_set_tiling, + .bo_get_tiling = bo_get_tiling, + .bo_is_busy = bo_is_busy, + .bo_is_referenced_by_cs = NULL, }; struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) diff --git a/radeon/radeon_bo_int.h b/radeon/radeon_bo_int.h index 9589ead..de981b0 100644 --- a/radeon/radeon_bo_int.h +++ b/radeon/radeon_bo_int.h @@ -2,7 +2,7 @@ #define RADEON_BO_INT struct radeon_bo_manager { - struct radeon_bo_funcs *funcs; + const struct radeon_bo_funcs *funcs; int fd; }; diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index 1962e91..cdec64e 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -514,16 +514,16 @@ static void cs_gem_print(struct radeon_cs_int *cs, FILE *file) } } -static struct radeon_cs_funcs radeon_cs_gem_funcs = { - cs_gem_create, - cs_gem_write_reloc, - cs_gem_begin, - cs_gem_end, - cs_gem_emit, - cs_gem_destroy, - cs_gem_erase, - cs_gem_need_flush, - cs_gem_print, +static const struct radeon_cs_funcs radeon_cs_gem_funcs = { + .cs_create = cs_gem_create, + .cs_write_reloc = cs_gem_write_reloc, + .cs_begin = cs_gem_begin, + .cs_end = cs_gem_end, + .cs_emit = cs_gem_emit, + .cs_destroy = cs_gem_destroy, + .cs_erase = cs_gem_erase, + .cs_need_flush = cs_gem_need_flush, + .cs_print = cs_gem_print, }; static int radeon_get_device_id(int fd, uint32_t *device_id) diff --git a/radeon/radeon_cs_int.h b/radeon/radeon_cs_int.h index 6cee574..d906ad4 100644 --- a/radeon/radeon_cs_int.h +++ b/radeon/radeon_cs_int.h @@ -58,7 +58,7 @@ struct radeon_cs_funcs { }; struct radeon_cs_manager { - struct radeon_cs_funcs *funcs; + const struct radeon_cs_funcs *funcs; int fd; int32_t vram_limit, gart_limit; int32_t vram_write_used, gart_write_used;