[PATCH] drm/nouveau: fix compile errors

Rob Clark robdclark at gmail.com
Wed Jan 25 17:30:40 UTC 2017


From: Rob Clark <rclark at redhat.com>

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;
                  ^

Signed-off-by: Rob Clark <rclark at redhat.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
index efac340..d352bbb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/gk104.c
@@ -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



More information about the dri-devel mailing list