[Mesa-dev] [PATCH] r600g, silence a few valgrind warnings
Marek Olšák
maraeo at gmail.com
Tue Feb 8 03:51:00 PST 2011
Pushed, thanks.
Marek
On Tue, Feb 8, 2011 at 2:57 AM, Brian Paterni <bpaterni at gmail.com> wrote:
> Hi all,
>
> Here's a small patch which silences a few unitialized bytes warnings in
> valgrind:
>
> diff --git a/src/gallium/winsys/r600/drm/r600_drm.c
> b/src/gallium/winsys/r600/drm/r600_drm.c
> index 096c178..f5cd48d 100644
> --- a/src/gallium/winsys/r600/drm/r600_drm.c
> +++ b/src/gallium/winsys/r600/drm/r600_drm.c
> @@ -67,7 +67,7 @@ unsigned r600_get_clock_crystal_freq(struct radeon
> *radeon)
>
> static int radeon_get_device(struct radeon *radeon)
> {
> - struct drm_radeon_info info;
> + struct drm_radeon_info info = {};
> int r;
>
> radeon->device = 0;
> diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c
> b/src/gallium/winsys/r600/drm/r600_hw_context.c
> index a939ec6..f170640 100644
> --- a/src/gallium/winsys/r600/drm/r600_hw_context.c
> +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c
> @@ -1088,7 +1088,7 @@ void r600_context_draw(struct r600_context *ctx,
> const struct r600_draw *draw)
>
> void r600_context_flush(struct r600_context *ctx)
> {
> - struct drm_radeon_cs drmib;
> + struct drm_radeon_cs drmib = {};
> struct drm_radeon_cs_chunk chunks[2];
> uint64_t chunk_array[2];
> unsigned fence;
> diff --git a/src/gallium/winsys/r600/drm/radeon_bo.c
> b/src/gallium/winsys/r600/drm/radeon_bo.c
> index 999de82..3643ddb 100644
> --- a/src/gallium/winsys/r600/drm/radeon_bo.c
> +++ b/src/gallium/winsys/r600/drm/radeon_bo.c
> @@ -98,7 +98,7 @@ struct radeon_bo *radeon_bo(struct radeon *radeon,
> unsigned handle,
> bo->size = open_arg.size;
> bo->shared = TRUE;
> } else {
> - struct drm_radeon_gem_create args;
> + struct drm_radeon_gem_create args = {};
>
> args.size = size;
> args.alignment = alignment;
> @@ -204,7 +204,7 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon,
> uint32_t *tiling_flags,
> uint32_t *pitch)
> {
> - struct drm_radeon_gem_get_tiling args;
> + struct drm_radeon_gem_get_tiling args = {};
> int ret;
>
> args.handle = bo->handle;
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110208/ab440e9b/attachment.htm>
More information about the mesa-dev
mailing list