All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <sean@poorly.run>
To: dri-devel@lists.freedesktop.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <seanpaul@chromium.org>,
	Gerd Hoffmann <kraxel@redhat.com>, Sean Paul <sean@poorly.run>
Subject: [PATCH 1/2] drm: Fix duplicate const warning in drm_gem_ttm_helper.c
Date: Fri, 20 Sep 2019 15:35:51 -0400	[thread overview]
Message-ID: <20190920193558.89815-1-sean@poorly.run> (raw)

From: Sean Paul <seanpaul@chromium.org>

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 <kraxel@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 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)
-- 
Sean Paul, Software Engineer, Google / Chromium OS

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-09-20 19:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 19:35 Sean Paul [this message]
2019-09-20 19:35 ` [PATCH 2/2] Documentation/gpu: Fix no structured comments warning for drm_gem_ttm_helper.h Sean Paul
2019-09-20 19:35   ` Sean Paul
2019-09-23  6:59   ` Gerd Hoffmann
2019-09-23  6:59     ` Gerd Hoffmann
2019-09-23 14:08     ` Sean Paul
2019-09-23 14:08       ` Sean Paul
2019-09-23  7:03   ` Thomas Zimmermann
2019-09-23  7:03     ` Thomas Zimmermann
2019-10-08 16:36     ` Daniel Vetter
2019-10-08 16:36       ` Daniel Vetter
2019-09-23  6:57 ` [PATCH 1/2] drm: Fix duplicate const warning in drm_gem_ttm_helper.c Thomas Zimmermann
2019-09-23  6:59 ` Gerd Hoffmann
2019-09-23 13:40   ` Sean Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190920193558.89815-1-sean@poorly.run \
    --to=sean@poorly.run \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=seanpaul@chromium.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.