Skip to contentSkip to conversation

drm: Fix duplicate const warning in drm_gem_ttm_helper.c

PATCH In review Sean Paul 4 participants 9 messages Sep 20, 2019 – Oct 8, 2019

Subsystems (3)
lore
Share & tools
lore

Sean Paul

author
#0 lore raw

PATCH 1/2 drm: Fix duplicate const warning in drm_gem_ttm_helper.c

From: Sean Paul <[email protected]>

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 <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
---
 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(-)
drivers/gpu/drm/drm_gem_ttm_helper.c +1 -1
index 9a4bafcf20df..ae7ba0052959 100644
@@ -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",
drivers/gpu/drm/drm_print.c +1 -1
index dfa27367ebb8..20c49c85b7a2 100644
@@ -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;
include/drm/drm_print.h +1 -1
index 12d4916254b4..1e6a4ee8a6b2 100644
@@ -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)
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#1 lore raw

PATCH 2/2 Documentation/gpu: Fix no structured comments warning for drm_gem_ttm_helper.h

From: Sean Paul <[email protected]>

Fixes
include/drm/drm_gem_ttm_helper.h:1: warning: no structured comments found

Fixes ff540b76f14a ("drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()")
Cc Gerd Hoffmann <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/drm-mm.rst | 3 ---
 1 file changed, 3 deletions(-)
Documentation/gpu/drm-mm.rst +0 -3
index 99d56015e077..59619296c84b 100644
@@ -406,9 +406,6 @@ GEM TTM Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :doc: overview
 
-.. kernel-doc:: include/drm/drm_gem_ttm_helper.h
-   :internal:
-
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :export:
 
Signature · 6 lines
Sean Paul, Software Engineer, Google / Chromium OS

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#3 lore raw

Re: [PATCH 2/2] Documentation/gpu: Fix no structured comments warning for drm_gem_ttm_helper.h

Quoted 8 lines · Gerd Hoffmann
Quoted 4 lines · Sean Paul

From: Sean Paul <[email protected]>

Fixes
include/drm/drm_gem_ttm_helper.h:1: warning: no structured comments found

Thanks, pushed to drm-misc-next

Sean

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] Documentation/gpu: Fix no structured comments warning for drm_gem_ttm_helper.h

In reply to Sean Paul

Hi

Am 20.09.19 um 21:35 schrieb Sean Paul:

Quoted 4 lines

From: Sean Paul <[email protected]>

Fixes
include/drm/drm_gem_ttm_helper.h:1: warning: no structured comments found

That missing documentation looks like an oversight to me.

under the premise that there's not currently some patch with the missing documentation floating around.

Best regards
Thomas

Quoted 30 lines
Fixes ff540b76f14a ("drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()")
Cc Gerd Hoffmann <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/drm-mm.rst | 3 ---
 1 file changed, 3 deletions(-)
Documentation/gpu/drm-mm.rst +0 -3
index 99d56015e077..59619296c84b 100644
@@ -406,9 +406,6 @@ GEM TTM Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :doc: overview
 
-.. kernel-doc:: include/drm/drm_gem_ttm_helper.h
-   :internal:
-
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :export:
 
Signature · 5 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH 2/2] Documentation/gpu: Fix no structured comments warning for drm_gem_ttm_helper.h

Quoted 8 lines · Thomas Zimmermann

Hi

Am 20.09.19 um 21:35 schrieb Sean Paul:

Quoted 4 lines

From: Sean Paul <[email protected]>

Fixes
include/drm/drm_gem_ttm_helper.h:1: warning: no structured comments found

Quoted 6 lines

That missing documentation looks like an oversight to me.

under the premise that there's not currently some patch with the missing documentation floating around.

There's no struct or inline functions in that header file, so really nothing to document. Just need to make sure that if we add anything, we re-add the include directive.
-Daniel

Quoted 42 lines

Best regards
Thomas

Quoted 30 lines
Fixes ff540b76f14a ("drm/ttm: add drm gem ttm helpers, starting with drm_gem_ttm_print_info()")
Cc Gerd Hoffmann <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 Documentation/gpu/drm-mm.rst | 3 ---
 1 file changed, 3 deletions(-)
Documentation/gpu/drm-mm.rst +0 -3
index 99d56015e077..59619296c84b 100644
@@ -406,9 +406,6 @@ GEM TTM Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :doc: overview
 
-.. kernel-doc:: include/drm/drm_gem_ttm_helper.h
-   :internal:
-
 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
    :export:
 
Signature · 5 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 1/2
#6 lore raw
In reply to Sean Paul

Hi

Am 20.09.19 um 21:35 schrieb Sean Paul:

Quoted 7 lines

From: Sean Paul <[email protected]>

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

Yes it is. Thanks for fixing.

Quoted 59 lines

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 <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
---
 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(-)
drivers/gpu/drm/drm_gem_ttm_helper.c +1 -1
index 9a4bafcf20df..ae7ba0052959 100644
@@ -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",
drivers/gpu/drm/drm_print.c +1 -1
index dfa27367ebb8..20c49c85b7a2 100644
@@ -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;
include/drm/drm_print.h +1 -1
index 12d4916254b4..1e6a4ee8a6b2 100644
@@ -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)
Signature · 5 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
In reply to Sean Paul
Quoted 4 lines · Sean Paul

From: Sean Paul <[email protected]>

For the warning
../drivers/gpu/drm/drm_gem_ttm_helper.c:26:20: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]

I have a drm_print_bits patch in flight which fixes this too (Cc'ed you on v2).

cheers,
Gerd

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#8 lore raw
Quoted 8 lines · Gerd Hoffmann
Quoted 4 lines · Sean Paul

From: Sean Paul <[email protected]>

For the warning
../drivers/gpu/drm/drm_gem_ttm_helper.c:26:20: warning: duplicate ‘const’ declaration specifier [-Wduplicate-decl-specifier]

I have a drm_print_bits patch in flight which fixes this too (Cc'ed you on v2).

Ah neat, thanks.

Sean

Quoted 4 lines

cheers,
Gerd

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel