[PATCH:xf86-video-ati] Fix uninitialized variable warnings reported by clang.

Michel Dänzer michel at daenzer.net
Tue Dec 15 00:25:49 PST 2015


On 12.12.2015 00:46, Thomas Klausner wrote:
> Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
> ---
>  src/radeon_drm_queue.c | 8 ++++----
>  src/radeon_kms.c       | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
> index 5e54ef8..84d0509 100644
> --- a/src/radeon_drm_queue.c
> +++ b/src/radeon_drm_queue.c
> @@ -59,7 +59,7 @@ radeon_drm_queue_handler(int fd, unsigned int frame, unsigned int sec,
>  			 unsigned int usec, void *user_ptr)
>  {
>  	struct radeon_drm_queue_entry *user_data = user_ptr;
> -	struct radeon_drm_queue_entry *e, *tmp;
> +	struct radeon_drm_queue_entry *e = NULL, *tmp;
>  
>  	xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_queue, list) {
>  		if (e == user_data) {
> @@ -119,7 +119,7 @@ radeon_drm_abort_one(struct radeon_drm_queue_entry *e)
>  void
>  radeon_drm_abort_client(ClientPtr client)
>  {
> -    struct radeon_drm_queue_entry *e, *tmp;
> +    struct radeon_drm_queue_entry *e = NULL, *tmp;
>  
>      xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_queue, list) {
>  	if (e->client == client)
> @@ -142,7 +142,7 @@ radeon_drm_abort_entry(struct radeon_drm_queue_entry *entry)
>  void
>  radeon_drm_abort_id(uint64_t id)
>  {
> -    struct radeon_drm_queue_entry *e, *tmp;
> +    struct radeon_drm_queue_entry *e = NULL, *tmp;
>  
>      xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_queue, list) {
>  	if (e->id == id) {
> @@ -170,7 +170,7 @@ radeon_drm_queue_init()
>  void
>  radeon_drm_queue_close(ScrnInfoPtr scrn)
>  {
> -    struct radeon_drm_queue_entry *e, *tmp;
> +    struct radeon_drm_queue_entry *e = NULL, *tmp;
>  
>      xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_queue, list) {
>  	if (e->scrn == scrn)
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index d459740..d6d17bc 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -303,7 +303,7 @@ static void
>  radeon_dirty_update(ScreenPtr screen)
>  {
>  	RegionPtr region;
> -	PixmapDirtyUpdatePtr ent;
> +	PixmapDirtyUpdatePtr ent = NULL;
>  
>  	if (xorg_list_is_empty(&screen->pixmap_dirty_list))
>  		return;
> 

NAK. This needs to be fixed in the xorg_list_for_each(_safe) macros in
xserver's list.h.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list