Skip to contentSkip to conversation

drm/nouveau: fix compile errors

PATCH In review Rob Clark 2 participants 3 messages Jan 25, 2017 – Jan 26, 2017

Subsystems (3)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm/nouveau: fix compile errors

From: Rob Clark <[email protected]>

Perhaps some newer versions of gcc are more clever about this.

drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c: In function 'gk104_top_oneinit':
include/linux/device.h:1164:45: error: 'inst' may be used uninitialized in this function [-Werror=maybe-uninitialized]

 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
                                             ^
drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c:32:18: note: 'inst' was declared here
  u32 data, type, inst;
                  ^
---
 drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c +1 -1
index efac340..d352bbb 100644
@@ -29,7 +29,7 @@ gk104_top_oneinit(struct nvkm_top *top)
 	struct nvkm_subdev *subdev = &top->subdev;
 	struct nvkm_device *device = subdev->device;
 	struct nvkm_top_device *info = NULL;
-	u32 data, type, inst;
+	u32 data, type = 0, inst = 0;
 	int i;
 
 	for (i = 0; i < 64; i++) {
Signature · 6 lines
2.9.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 8 lines · Rob Clark

From: Rob Clark <[email protected]>

Perhaps some newer versions of gcc are more clever about this.

drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c: In function 'gk104_top_oneinit':
include/linux/device.h:1164:45: error: 'inst' may be used uninitialized in this function [-Werror=maybe-uninitialized]

 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
                                             ^

Why is maybe-unitialized an error? We've tried that with i915, it ended in tears ...
-Daniel

Quoted 29 lines

drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c:32:18: note: 'inst' was declared here

  u32 data, type, inst;
                  ^
---
 drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c +1 -1
index efac340..d352bbb 100644
@@ -29,7 +29,7 @@ gk104_top_oneinit(struct nvkm_top *top)
 	struct nvkm_subdev *subdev = &top->subdev;
 	struct nvkm_device *device = subdev->device;
 	struct nvkm_top_device *info = NULL;
-	u32 data, type, inst;
+	u32 data, type = 0, inst = 0;
 	int i;
 
 	for (i = 0; i < 64; i++) {
Signature · 6 lines
2.9.3

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
author
#2 lore raw
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Rob Clark

From: Rob Clark <[email protected]>

Perhaps some newer versions of gcc are more clever about this.

Quoted 7 lines
Quoted 4 lines

drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c: In function 'gk104_top_oneinit':
include/linux/device.h:1164:45: error: 'inst' may be used uninitialized in this function [-Werror=maybe-uninitialized]

 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
                                             ^

Why is maybe-unitialized an error? We've tried that with i915, it ended in tears ...

tbh, I'm not entirely sure. It ends up coming from *somewhere* for rhel kernel rpm build ;-)

BR,
-R

Quoted 27 lines

-Daniel

Quoted 25 lines

drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c:32:18: note: 'inst' was declared here

  u32 data, type, inst;
                  ^
---
 drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c +1 -2
index efac340..d352bbb 100644
@@ -29,7 +29,7 @@ gk104_top_oneinit(struct nvkm_top *top)
      struct nvkm_subdev *subdev = &top->subdev;
      struct nvkm_device *device = subdev->device;
      struct nvkm_top_device *info = NULL;
-     u32 data, type, inst;
+     u32 data, type = 0, inst = 0;
      int i;
 
      for (i = 0; i < 64; i++) {
--

2.9.3

Quoted 9 lines
Quoted 4 lines

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

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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