From patchwork Fri Sep 20 19:35:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11154815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F99C14DB for ; Fri, 20 Sep 2019 19:36:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47E982080F for ; Fri, 20 Sep 2019 19:36:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47E982080F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3132E6E0BB; Fri, 20 Sep 2019 19:36:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc41.google.com (mail-yw1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) by gabe.freedesktop.org (Postfix) with ESMTPS id A04706E0BB for ; Fri, 20 Sep 2019 19:36:02 +0000 (UTC) Received: by mail-yw1-xc41.google.com with SMTP id n11so2883500ywn.6 for ; Fri, 20 Sep 2019 12:36:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r27pJo91QpO7bKM8Lp6TXgu9Rs6sf8em9A1gFRf00oE=; b=cGYQimXS2QZbrHC1zUP2aLdjyv+SRXVHbfZnDAXCyJYqKQjJZ4XTLswQ6YBORIqHBD QYKnmeO1BaQ6FsvyJpNa1VZj1L6P9o0fvt1vII27kug+8qJYOOBAHxINENKzuCseezCv IQaqQodjAPyf+XuqQ64bMX5CzYzOW8PdxErbz6pi8eRK34zEIFmmNcGwSweMGtxtDQzw 5s3dV1j4rDYR6qwmhWVq1JSevXsUprq96h2IF3LMab88qUDRuEzX8+ZeXCkjWMrDGx+U rfafSrlwyZO4xzYFqdezAuH79l0N02RPdmdOQds9iCvzFKqwzKuClYqGyDyM1ZLSyFCX fg5w== X-Gm-Message-State: APjAAAXB/fnI2kEhJpRHMyXsPdalOeVqgGo/txxbBGoYf1lKob1w6npa 1FVJJ6Eq+7hd8G5MPhvZnY3Im0w8eJlYOw== X-Google-Smtp-Source: APXvYqwOOAA02s9o6SUl/Ha9P4+dQM83JGTWQj2zmMbuwOawEUkj1+HAIwW55Lm29Y8EBtldBd9PqA== X-Received: by 2002:a81:628a:: with SMTP id w132mr14682435ywb.290.1569008161471; Fri, 20 Sep 2019 12:36:01 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id g1sm655126ywk.53.2019.09.20.12.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Sep 2019 12:35:59 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm: Fix duplicate const warning in drm_gem_ttm_helper.c Date: Fri, 20 Sep 2019 15:35:51 -0400 Message-Id: <20190920193558.89815-1-sean@poorly.run> X-Mailer: git-send-email 2.23.0.351.gc4317032e6-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r27pJo91QpO7bKM8Lp6TXgu9Rs6sf8em9A1gFRf00oE=; b=WOwdN1o6x27mPCn2RbPXDxhuuAAHceXlyVdKKpqUNT1P9moo00QlqWCJ1RX67yr1hO aEAlL+emgiL5EM3Cvn0F7iXN7BKwX+IdqxVWsQI92T0/66b4InlO6Itjt7dbDrxHTPO4 7lwLb5Z2faq611SBPaoDWjYHDX4B6/bjioX4D0ppeehZvyLcZx903BdiMtzFQ9J+xg+h i8S26gWRrVrwteiOO5ZETrz7cv4LEb8JBPIMRWme3H3bthXO3Q6hh5rWsDVVG0WSM8om LcOdwfOPMJBDdU35KOYb3STdLmLneAgfb5SxoF4OeR6xpY/K5ju2BwFgy4sV4PehbrGE SUZA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , David Airlie , Daniel Vetter , Maxime Ripard , Sean Paul , Gerd Hoffmann , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul For the warning ../drivers/gpu/drm/drm_gem_ttm_helper.c:26:20: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier] Reading between the lines, I think the double const is to preserve both the values and the pointers in the array (which makes total sense). This patch moves the second const to achieve this (and fix the warning). Fixes: ff540b76f14a ("drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()") Cc: Gerd Hoffmann Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: David Airlie Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sean Paul Reviewed-By: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_ttm_helper.c | 2 +- drivers/gpu/drm/drm_print.c | 2 +- include/drm/drm_print.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_ttm_helper.c b/drivers/gpu/drm/drm_gem_ttm_helper.c index 9a4bafcf20df..ae7ba0052959 100644 --- a/drivers/gpu/drm/drm_gem_ttm_helper.c +++ b/drivers/gpu/drm/drm_gem_ttm_helper.c @@ -23,7 +23,7 @@ void drm_gem_ttm_print_info(struct drm_printer *p, unsigned int indent, const struct drm_gem_object *gem) { - static const char const *plname[] = { + static const char * const plname[] = { [ TTM_PL_SYSTEM ] = "system", [ TTM_PL_TT ] = "tt", [ TTM_PL_VRAM ] = "vram", diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index dfa27367ebb8..20c49c85b7a2 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -198,7 +198,7 @@ EXPORT_SYMBOL(drm_printf); * @to: end of bit range to print (exclusive). */ void drm_print_bits(struct drm_printer *p, - unsigned long value, const char *bits[], + unsigned long value, const char * const bits[], unsigned int from, unsigned int to) { bool first = true; diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 12d4916254b4..1e6a4ee8a6b2 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -90,7 +90,7 @@ void drm_printf(struct drm_printer *p, const char *f, ...); void drm_puts(struct drm_printer *p, const char *str); void drm_print_regset32(struct drm_printer *p, struct debugfs_regset32 *regset); void drm_print_bits(struct drm_printer *p, - unsigned long value, const char *bits[], + unsigned long value, const char * const bits[], unsigned int from, unsigned int to); __printf(2, 0)