Re: [PATCH] drm/nouveau: fix compile errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 25, 2017 at 12:30:40PM -0500, Rob Clark wrote:
> From: Rob Clark <rclark@xxxxxxxxxx>
> 
> 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

> 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@xxxxxxxxxx>
> ---
>  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
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux