Skip to contentSkip to conversation

drm/nouveau/nvif: remove const attribute from nvif_mclass

PATCH Superseded Nick Desaulniers 2 participants 4 messages Jun 15, 2018 – Jun 16, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/nvif: remove const attribute from nvif_mclass

Similar to commit 0bf8bf50eddc ("module: Remove const attribute from alias for MODULE_DEVICE_TABLE")

Fixes many -Wduplicate-decl-specifier warnings due to the combination of const typeof() of already const variables.

---
 drivers/gpu/drm/nouveau/include/nvif/object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/include/nvif/object.h +1 -1
index a2d5244ff2b7..7f188f66931e 100644
@@ -78,7 +78,7 @@ struct nvif_mclass {
 #define nvif_mclass(o,m) ({                                                    \
 	struct nvif_object *object = (o);                                      \
 	struct nvif_sclass *sclass;                                            \
-	const typeof(m[0]) *mclass = (m);                                      \
+	typeof(m[0]) *mclass = (m);                                      \
 	int ret = -ENODEV;                                                     \
 	int cnt, i, j;                                                         \
                                                                                \
Signature · 1 line
2.18.0.rc1.244.gcf134e6275-goog
#1 lore raw
Quoted 17 lines · Nick Desaulniers

Similar to commit 0bf8bf50eddc ("module: Remove const attribute from alias for MODULE_DEVICE_TABLE")

Fixes many -Wduplicate-decl-specifier warnings due to the combination of const typeof() of already const variables.

---
 drivers/gpu/drm/nouveau/include/nvif/object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/include/nvif/object.h +0 -0
index a2d5244ff2b7..7f188f66931e 100644

drivers/gpu/drm/nouveau/include/nvif/object.h struct nvif_mclass { · line 81

Quoted 5 lines
drivers/gpu/drm/nouveau/include/nvif/object.h +1 -1
@@ -78,7 +78,7 @@ struct nvif_mclass {
 #define nvif_mclass(o,m) ({                                                    \
        struct nvif_object *object = (o);                                      \
        struct nvif_sclass *sclass;                                            \
-       const typeof(m[0]) *mclass = (m);                                      \
+       typeof(m[0]) *mclass = (m);                                      \

Sorry, this messes up the spaces at the end, will send a v2.

Quoted 6 lines
drivers/gpu/drm/nouveau/include/nvif/object.h +0 -1
        int ret = -ENODEV;                                                     \
        int cnt, i, j;                                                         \
                                                                                \
--

2.18.0.rc1.244.gcf134e6275-goog

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw

PATCH v2 1/1 drm/nouveau/nvif: remove const attribute from nvif_mclass

Similar to commit 0bf8bf50eddc ("module: Remove const attribute from alias for MODULE_DEVICE_TABLE")

Fixes many -Wduplicate-decl-specifier warnings due to the combination of const typeof() of already const variables.

---
Changes since v1: added additional space after statements.

 drivers/gpu/drm/nouveau/include/nvif/object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/include/nvif/object.h +1 -1
index a2d5244ff2b7..3d7e485a9043 100644
@@ -78,7 +78,7 @@ struct nvif_mclass {
 #define nvif_mclass(o,m) ({                                                    \
 	struct nvif_object *object = (o);                                      \
 	struct nvif_sclass *sclass;                                            \
-	const typeof(m[0]) *mclass = (m);                                      \
+	typeof(m[0]) *mclass = (m);                                            \
 	int ret = -ENODEV;                                                     \
 	int cnt, i, j;                                                         \
                                                                                \
Signature · 1 line
2.18.0.rc1.244.gcf134e6275-goog
Reviewed-by on v2 1/1
#3 lore raw
Quoted 7 lines · Nick Desaulniers

Similar to commit 0bf8bf50eddc ("module: Remove const attribute from alias for MODULE_DEVICE_TABLE")

Fixes many -Wduplicate-decl-specifier warnings due to the combination of const typeof() of already const variables.

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