mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Deepak Singh Rawat <drawat@vmware.com>
To: Nathan Chancellor <natechancellor@gmail.com>,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Thomas Hellstrom <thellstrom@vmware.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<clang-built-linux@googlegroups.com>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] drm/vmwgfx: Zero initialize handle in vmw_execbuf_process
Date: Mon, 11 Mar 2019 10:01:16 -0700	[thread overview]
Message-ID: <35b4b2dfe93ce406ff26e6d75d6c6b97824de36e.camel@vmware.com> (raw)
In-Reply-To: <20190307222611.18100-1-natechancellor@gmail.com>

Hi Nathan,

Thanks for doing this. I will include this in vmwgfx-next.

Reviewed-by: Deepak Rawat <drawat@vmware.com>

On Thu, 2019-03-07 at 15:26 -0700, Nathan Chancellor wrote:
> When building with -Wsometimes-uninitialized, Clang warns:
> 
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:3964:7: warning: variable
> 'handle' is used uninitialized whenever '?:' condition is false
> [-Wsometimes-uninitialized]
> 
> It's not wrong; however, in practice, this is never an issue because
> the value of handle isn't used when user_fence_rep is NULL because
> vmw_execbuf_copy_fence_user returns immediately when that is the
> case.
> Just zero initialize this variable so that Clang no longer warns.
> 
> Link: 
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FClangBuiltLinux%2Flinux%2Fissues%2F397&amp;data=02%7C01%7Cdrawat%40vmware.com%7C6b9c429d16d844a5740c08d6a34bedb4%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636875943916412703&amp;sdata=Yf7%2BzrbZS96yNJQewYQQ7YsHUDtJSvPaomyTJFZjsDk%3D&amp;reserved=0
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> index 88b8178d4687..4ba06c2828a1 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
> @@ -3829,7 +3829,7 @@ int vmw_execbuf_process(struct drm_file
> *file_priv,
>  	struct vmw_sw_context *sw_context = &dev_priv->ctx;
>  	struct vmw_fence_obj *fence = NULL;
>  	struct vmw_cmdbuf_header *header;
> -	uint32_t handle;
> +	uint32_t handle = 0;
>  	int ret;
>  	int32_t out_fence_fd = -1;
>  	struct sync_file *sync_file = NULL;


      parent reply	other threads:[~2019-03-11 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 22:26 Nathan Chancellor
2019-03-08  0:28 ` Nick Desaulniers
2019-03-11 17:01 ` Deepak Singh Rawat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35b4b2dfe93ce406ff26e6d75d6c6b97824de36e.camel@vmware.com \
    --to=drawat@vmware.com \
    --cc=airlied@linux.ie \
    --cc=clang-built-linux@googlegroups.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=thellstrom@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®